#include <ObjectAgent.h>
Inheritance diagram for ObjectAgent:
Public Member Functions | |
ObjectAgent (const ObjectAgent::Config &config) | |
Constructor - initialize whole object. | |
virtual | ~ObjectAgent () |
Destructor. | |
virtual void | Collision (Object *collisionObject) |
Handles collision caused by another object. | |
virtual Object::Config * | CreateObjectConfig () const |
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) |
Sets a new action. | |
virtual void | SetDirection (const Direction &newDirection) |
Sets a new direction. | |
virtual const Priority & | GetPriority () const |
Returns object's priority. | |
virtual bool | CanAppearMoreThenOnce () const |
Returns true if selected object can appear more then once in the container (in Matrix). | |
virtual const string & | GetClassName () const |
Returns object's name (class name, respectively). | |
virtual void | ChooseNextAction () |
Object will choose it's new action. | |
virtual bool | IsImaginary () const |
Some kinds of objects are only imaginary and other objects can stand or lay on it. Agents aren't imaginery. | |
virtual bool | IsEditableByUser () const |
Returns true if the object is editable by user (e.g. via graphical window). | |
virtual bool | IsMoveableByUser () const |
Returns true if the object is moveable by user (e.g. moved to another place). | |
bool | HasObject () const |
Returns true if the agent is carrying object. | |
void | TakeObject (ObjectTransferable *object) |
Takes object from the ground. | |
ObjectTransferable * | DropObject () |
Drops object. | |
string | GetBehavior () const |
Queries agent for it's behavior. | |
void | ChangeBehavior (const string &newBehavior) |
Changes agent's behavior. | |
const string & | GetTrailImageFileName () const |
Returns image file name of the trail. | |
ObjectTrail::DurationSize | GetTrailDuration () const |
Returns trail duration. | |
bool | IsPuttingTrail () const |
Returns true if the agent's is putting trails. | |
Static Public Attributes | |
static const string | CLASS_NAME = "ObjectAgent" |
Name of the class. | |
Private Member Functions | |
void | Interpret () |
Calls interpret when agent should decide next action after no collision happened to him in the last turn. | |
void | Interpret (string type) |
Calls interpret when agent is in collision. | |
bool | SimkinHasObject () const |
Returns true if the agent is carrying object. | |
bool | SimkinTakeObject () |
Takes object from the ground. | |
bool | SimkinDropObject () |
Drops object. | |
void | SimkinTurnLeft () |
Turns left (change direction). | |
void | SimkinTurnRight () |
Turns right (change direction). | |
void | SimkinTurnBack () |
Turns back (change direction - turning round). | |
void | SimkinGo () |
Goes forward (one step). | |
void | RandomAction () |
Performs random action. | |
Private Attributes | |
ObjectTransferable * | carryingObject |
This points to the carrying object (if any). | |
GUI::Image | trailImage |
Picture of agent's trail. | |
ObjectTrail::DurationSize | trailDuration |
Duration of agent's trail. | |
bool | nextActionSet |
Holds information whether the object has already set its next action. | |
Behavior | behavior |
Object carrying info about behaviour script (Simkin). | |
Static Private Attributes | |
static const Object::Priority | PRIORITY = 10 |
Priority of the object. | |
static const bool | CAN_APPEAR_MORE_THEN_ONCE = false |
If true, object can appear more then once in the container (in Matrix). | |
static const int | AGENT_MOVEMENT_ACTIONS = Object::Action::TURN_BACK - Object::Action::FIRST_ACTION |
Maximum (movement) actions that object can perform. | |
Friends | |
class | Interpreter |
Classes | |
class | Behavior |
Agent's behavior information. More... | |
class | Config |
Config object for agents in the matrix. More... |
ObjectAgent::ObjectAgent | ( | const ObjectAgent::Config & | config | ) |
virtual ObjectAgent::~ObjectAgent | ( | ) | [inline, virtual] |
Destructor.
virtual bool ObjectAgent::CanAppearMoreThenOnce | ( | ) | const [inline, virtual] |
void ObjectAgent::ChangeBehavior | ( | const string & | newBehavior | ) | [inline] |
Changes agent's behavior.
virtual void ObjectAgent::ChooseNextAction | ( | ) | [inline, virtual] |
void ObjectAgent::Collision | ( | Object * | collisionObject | ) | [virtual] |
Handles collision caused by another object.
collisionObject | Conflicting object |
Implements Object.
Object::Config * ObjectAgent::CreateObjectConfig | ( | ) | const [virtual] |
ObjectTransferable* ObjectAgent::DropObject | ( | ) | [inline] |
Drops object.
string ObjectAgent::GetBehavior | ( | ) | const [inline] |
Queries agent for it's behavior.
virtual const string& ObjectAgent::GetClassName | ( | ) | const [inline, virtual] |
virtual const Priority& ObjectAgent::GetPriority | ( | ) | const [inline, virtual] |
ObjectTrail::DurationSize ObjectAgent::GetTrailDuration | ( | ) | const [inline] |
Returns trail duration.
const string& ObjectAgent::GetTrailImageFileName | ( | ) | const [inline] |
Returns image file name of the trail.
bool ObjectAgent::HasObject | ( | ) | const [inline] |
Returns true if the agent is carrying object.
void ObjectAgent::Interpret | ( | string | type | ) | [private] |
Calls interpret when agent is in collision.
type | Type of the collision |
void ObjectAgent::Interpret | ( | ) | [private] |
Calls interpret when agent should decide next action after no collision happened to him in the last turn.
virtual bool ObjectAgent::IsEditableByUser | ( | ) | const [inline, virtual] |
virtual bool ObjectAgent::IsImaginary | ( | ) | const [inline, virtual] |
Some kinds of objects are only imaginary and other objects can stand or lay on it. Agents aren't imaginery.
Implements Object.
virtual bool ObjectAgent::IsMoveableByUser | ( | ) | const [inline, virtual] |
bool ObjectAgent::IsPuttingTrail | ( | ) | const [inline] |
Returns true if the agent's is putting trails.
void ObjectAgent::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 from Object.
void ObjectAgent::RandomAction | ( | ) | [private] |
Performs random action.
virtual void ObjectAgent::SetAction | ( | const Action & | newAction | ) | [inline, virtual] |
Sets a new action.
newAction | New action that has to be set |
virtual void ObjectAgent::SetDirection | ( | const Direction & | newDirection | ) | [inline, virtual] |
bool ObjectAgent::SimkinDropObject | ( | ) | [inline, private] |
Drops object.
void ObjectAgent::SimkinGo | ( | ) | [inline, private] |
Goes forward (one step).
bool ObjectAgent::SimkinHasObject | ( | ) | const [inline, private] |
Returns true if the agent is carrying object.
bool ObjectAgent::SimkinTakeObject | ( | ) | [inline, private] |
Takes object from the ground.
void ObjectAgent::SimkinTurnBack | ( | ) | [inline, private] |
Turns back (change direction - turning round).
void ObjectAgent::SimkinTurnLeft | ( | ) | [inline, private] |
Turns left (change direction).
void ObjectAgent::SimkinTurnRight | ( | ) | [inline, private] |
Turns right (change direction).
void ObjectAgent::TakeObject | ( | ObjectTransferable * | object | ) | [inline] |
friend class Interpreter [friend] |
const int ObjectAgent::AGENT_MOVEMENT_ACTIONS = Object::Action::TURN_BACK - Object::Action::FIRST_ACTION [static, private] |
Maximum (movement) actions that object can perform.
Behavior ObjectAgent::behavior [private] |
Object carrying info about behaviour script (Simkin).
const bool ObjectAgent::CAN_APPEAR_MORE_THEN_ONCE = false [static, private] |
If true, object can appear more then once in the container (in Matrix).
ObjectTransferable* ObjectAgent::carryingObject [private] |
This points to the carrying object (if any).
const string ObjectAgent::CLASS_NAME = "ObjectAgent" [static] |
Name of the class.
bool ObjectAgent::nextActionSet [private] |
Holds information whether the object has already set its next action.
const Object::Priority ObjectAgent::PRIORITY = 10 [static, private] |
Priority of the object.
Duration of agent's trail.
GUI::Image ObjectAgent::trailImage [private] |
Picture of agent's trail.