Represents some big resource. In this case, a text "image" rendered as a list of strings. each entry in the list is the same width. The height of the "image" is the number of entries in the list. This image is provided by the user. More...
Public Member Functions | |
Flyweight_Class | CreateFlyweight (Flyweight_Context context) |
Generate a Flyweight class that will represent this big resource in some context-dependent way. | |
Package Functions | |
BigResource (List< string > resource, int resourceId) | |
Constructor (accessibly only to the class factory). | |
void | Render (List< char[]> display, int offset_x, int image_width, int image_height, int position_x, int position_y) |
Render the big resource into the given display at the given position. | |
Properties | |
int | ResourceId [get] |
Retrieve the resource ID for this resource. | |
int | ImageWidth [get] |
Retrieve the "image" width of the resource. | |
int | ImageHeight [get] |
Retrieve the "image" height of the resource. | |
Private Attributes | |
List< string > | _resource |
int | _resourceId |
Represents some big resource. In this case, a text "image" rendered as a list of strings. each entry in the list is the same width. The height of the "image" is the number of entries in the list. This image is provided by the user.
The resource is represented by an ID. This ID is known by the user and is passed to the Flyweight_Class factory so the Flyweight_Class can get a reference to an instance of this BigResource class. Instances of this BigResource class are managed through the BigResourceManager class.
Definition at line 192 of file Flyweight_Class.cs.
|
inlinepackage |
Constructor (accessibly only to the class factory).
resource | The resource to manage. |
resourceId | ID of the resource. |
Definition at line 202 of file Flyweight_Class.cs.
References BigResource._resource, and BigResource._resourceId.
|
inline |
Generate a Flyweight class that will represent this big resource in some context-dependent way.
context | A Flyweight_Context instance containing the context for the desired Flyweight_Class instance. |
Definition at line 322 of file Flyweight_Class.cs.
Referenced by BigResourceManager.CreateFlyweight().
|
inlinepackage |
Render the big resource into the given display at the given position.
display | The display in which to render. |
offset_x | Offset from left edge of big resource to the left edge of the image to render. |
image_width | Width of image to render. |
image_height | Height of image to render. |
position_x | X position where to put upper left corner of resource. |
position_y | Y position where to put upper left corner of resource. |
Definition at line 218 of file Flyweight_Class.cs.
References BigResource._resource.
Referenced by Flyweight_Class.Render().
|
private |
Definition at line 194 of file Flyweight_Class.cs.
Referenced by BigResource.BigResource(), Flyweight_Class.ImageHeight(), BigResource.ImageHeight(), Flyweight_Class.ImageWidth(), BigResource.ImageWidth(), BigResource.Render(), and Flyweight_Class.Render().
|
private |
Definition at line 195 of file Flyweight_Class.cs.
Referenced by BigResource.BigResource(), and BigResource.ResourceId().
|
get |
Retrieve the "image" height of the resource.
Definition at line 303 of file Flyweight_Class.cs.
|
get |
Retrieve the "image" width of the resource.
Definition at line 288 of file Flyweight_Class.cs.
|
get |
Retrieve the resource ID for this resource.
Definition at line 277 of file Flyweight_Class.cs.
Referenced by BigResourceManager.FindResource().