Design Pattern Examples
Overview of object-oriented design patterns
Flyweight_Context Struct Reference

Represents the context for an instance of the Flyweight_Image structure. In this case, the context includes position and velocity. More...

#include <Flyweight_Context.h>

Collaboration diagram for Flyweight_Context:
Collaboration graph

Public Attributes

int OffsetXToImage
 Offset into big resource to left edge of image.
 
int ImageWidth
 Width of image.
 
int ImageHeight
 Height of image.
 
double Position_X
 Horizontal position of upper left corner of image in a display.
 
double Position_Y
 Vertical position of upper left corner of image in a display.
 
double Velocity_X
 Velocity to apply to the horizontal position.
 
double Velocity_Y
 Velocity to apply to the vertical position.
 

Detailed Description

Represents the context for an instance of the Flyweight_Image structure. In this case, the context includes position and velocity.

This context is manipulated outside the Flyweight Image by the controlling entity (in this case, the Flyweight_Exercise() function). The Flyweight_Image structure just holds onto the context, along with a handle to the big resource.

Definition at line 19 of file Flyweight_Context.h.

Member Data Documentation

◆ ImageHeight

int ImageHeight

◆ ImageWidth

int ImageWidth

◆ OffsetXToImage

int OffsetXToImage

Offset into big resource to left edge of image.

Definition at line 21 of file Flyweight_Context.h.

Referenced by _Flyweight_GenerateFlyweightClasses(), and _Flyweight_RenderFlyweights().

◆ Position_X

double Position_X

Horizontal position of upper left corner of image in a display.

Definition at line 24 of file Flyweight_Context.h.

Referenced by _Flyweight_GenerateFlyweightClasses(), _Flyweight_MoveFlyweights(), and _Flyweight_RenderFlyweights().

◆ Position_Y

double Position_Y

Vertical position of upper left corner of image in a display.

Definition at line 25 of file Flyweight_Context.h.

Referenced by _Flyweight_GenerateFlyweightClasses(), _Flyweight_MoveFlyweights(), and _Flyweight_RenderFlyweights().

◆ Velocity_X

double Velocity_X

Velocity to apply to the horizontal position.

Definition at line 26 of file Flyweight_Context.h.

Referenced by _Flyweight_GenerateFlyweightClasses(), and _Flyweight_MoveFlyweights().

◆ Velocity_Y

double Velocity_Y

Velocity to apply to the vertical position.

Definition at line 27 of file Flyweight_Context.h.

Referenced by _Flyweight_GenerateFlyweightClasses(), and _Flyweight_MoveFlyweights().


The documentation for this struct was generated from the following file: