#include <Object.h>
Inheritance diagram for Object:
Public Types | |
typedef int | Priority |
Priority type. | |
typedef size_t | TicketSize |
Data type of the ticket size. | |
Public Member Functions | |
Object (const Config &config) | |
Constructor - config initializes whole object. | |
virtual | ~Object () |
Destructor. | |
virtual void | Collision (Object *collisionObject)=0 |
Handles collision caused by another object. | |
virtual Config * | CreateObjectConfig () const =0 |
Returns full object's config (allocated on the heap). | |
virtual void | LoadFromConfig (const Object::Config &config, bool fullLoad=true) |
Loads object state (attributes etc.) from the selected config. | |
virtual void | SetAction (const Action &newAction)=0 |
Sets a new action. | |
const Action & | GetAction () const |
Returns object's action. | |
virtual void | SetDirection (const Direction &newDirection)=0 |
Sets a new direction. | |
void | ChangeDirectionAccToAction () |
Sets new direction according to the current action. | |
const Direction & | GetDirection () const |
Returns object's direction. | |
void | DrawImage (wxCoord x, wxCoord y, wxDC &dc) |
Draws image on the matrix. | |
void | ScaleImage (int size) |
Scales image. | |
virtual const Priority & | GetPriority () const =0 |
Returns object's priority. | |
virtual bool | CanAppearMoreThenOnce () const =0 |
Returns true if selected object can appear more then once in the container (in Matrix). | |
virtual const string & | GetClassName () const =0 |
Returns object's name (class name, respectively). | |
virtual void | ChooseNextAction ()=0 |
Object will choose it's new action. | |
virtual bool | IsImaginary () const =0 |
Some kinds of objects are only imaginary and other objects can stand or lay on it. This method returns if the object is imaginary or not. | |
virtual bool | IsEditableByUser () const =0 |
Returns true if the object is editable by user (e.g. via graphical window). | |
virtual bool | IsMoveableByUser () const =0 |
Returns true if the object is moveable by user (e.g. moved to another place). | |
void | SetTicketNumber (TicketSize number) |
Sets ticket number. | |
TicketSize | GetTicketNumber () const |
Returns current ticket number. | |
void | SetObjectName (const string &newName) |
Sets object name. | |
const string & | GetObjectName () const |
Gets object name. | |
void | SetObjectDescription (const string &newDescription) |
Sets object description. | |
const string & | GetObjectDescription () const |
Gets object description. | |
Protected Member Functions | |
const string & | GetImageFileName () const |
Returns file name of the image (with path). | |
void | ChangeImage (const string &newImageFileName) |
Changes object image according to the new image filename. | |
Protected Attributes | |
Direction | direction |
Direction. | |
Action | action |
Action. | |
Private Attributes | |
GUI::Image | image |
Image. | |
TicketSize | ticketNumber |
Ticket from the matrix. | |
string | name |
Name of the object. | |
string | description |
Description of the object. | |
Classes | |
class | Action |
Possible object actions. More... | |
class | Config |
Base config object for the objects in the matrix. More... |
Every object in the matrix must be derived from this class.
typedef int Object::Priority |
typedef size_t Object::TicketSize |
Data type of the ticket size.
Object::Object | ( | const Config & | config | ) | [inline] |
Constructor - config initializes whole object.
config | In this object is stored every information needed to construct whole object |
virtual Object::~Object | ( | ) | [inline, virtual] |
Destructor.
virtual bool Object::CanAppearMoreThenOnce | ( | ) | const [pure virtual] |
Returns true if selected object can appear more then once in the container (in Matrix).
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
void Object::ChangeDirectionAccToAction | ( | ) |
Sets new direction according to the current action.
Only actions that change direction.
void Object::ChangeImage | ( | const string & | newImageFileName | ) | [inline, protected] |
Changes object image according to the new image filename.
newImageFileName | File name of the file containing new image |
virtual void Object::ChooseNextAction | ( | ) | [pure virtual] |
Object will choose it's new action.
Each object should decide its next action.
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
virtual void Object::Collision | ( | Object * | collisionObject | ) | [pure virtual] |
Handles collision caused by another object.
collisionObject | Conflicting object |
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
virtual Config* Object::CreateObjectConfig | ( | ) | const [pure virtual] |
Returns full object's config (allocated on the heap).
Warning: Config is allocated on the heap in this member function, so explicit deleting after usage is needed!
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
void Object::DrawImage | ( | wxCoord | x, | |
wxCoord | y, | |||
wxDC & | dc | |||
) | [inline] |
Draws image on the matrix.
x | X-line | |
y | Y-line | |
dc | Device context onto which graphics can be drawn. |
const Action& Object::GetAction | ( | ) | const [inline] |
Returns object's action.
virtual const string& Object::GetClassName | ( | ) | const [pure virtual] |
Returns object's name (class name, respectively).
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
const Direction& Object::GetDirection | ( | ) | const [inline] |
Returns object's direction.
const string& Object::GetImageFileName | ( | ) | const [inline, protected] |
Returns file name of the image (with path).
Needed in configs.
const string& Object::GetObjectDescription | ( | ) | const [inline] |
Gets object description.
const string& Object::GetObjectName | ( | ) | const [inline] |
Gets object name.
virtual const Priority& Object::GetPriority | ( | ) | const [pure virtual] |
Returns object's priority.
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
TicketSize Object::GetTicketNumber | ( | ) | const [inline] |
Returns current ticket number.
virtual bool Object::IsEditableByUser | ( | ) | const [pure virtual] |
Returns true if the object is editable by user (e.g. via graphical window).
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
virtual bool Object::IsImaginary | ( | ) | const [pure virtual] |
Some kinds of objects are only imaginary and other objects can stand or lay on it. This method returns if the object is imaginary or not.
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
virtual bool Object::IsMoveableByUser | ( | ) | const [pure virtual] |
Returns true if the object is moveable by user (e.g. moved to another place).
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
void Object::LoadFromConfig | ( | const Object::Config & | config, | |
bool | fullLoad = true | |||
) | [virtual] |
Loads object state (attributes etc.) from the selected config.
config | Object's config | |
fullLoad | Should object load all data from the config, or only some? |
Reimplemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
void Object::ScaleImage | ( | int | size | ) | [inline] |
Scales image.
size | Size of the picture in pixels |
virtual void Object::SetAction | ( | const Action & | newAction | ) | [pure virtual] |
Sets a new action.
newAction | New action that has to be set |
virtual void Object::SetDirection | ( | const Direction & | newDirection | ) | [pure virtual] |
Sets a new direction.
newDirection | New direction that has to be set |
Implemented in ObjectAgent, ObjectFixed, ObjectTrail, and ObjectTransferable.
void Object::SetObjectDescription | ( | const string & | newDescription | ) | [inline] |
Sets object description.
newDescription | New description to be set |
void Object::SetObjectName | ( | const string & | newName | ) | [inline] |
Sets object name.
newName | Name to be set |
void Object::SetTicketNumber | ( | TicketSize | number | ) | [inline] |
Sets ticket number.
number | Ticket number to be set |
Action Object::action [protected] |
string Object::description [private] |
Description of the object.
Direction Object::direction [protected] |
GUI::Image Object::image [private] |
Image.
string Object::name [private] |
Name of the object.
TicketSize Object::ticketNumber [private] |
Ticket from the matrix.