flimEngine
Cottage Class Reference

#include <Cottage.h>

Inheritance diagram for Cottage:
Inheritance graph
Collaboration diagram for Cottage:
Collaboration graph

Public Member Functions

 Cottage ()
 
 Cottage (const Cottage &)=default
 
virtual ~Cottage ()
 
const Cottageoperator= (const Cottage &)
 
void Initialize (int x, int y, int z)
 
void Initialize (int x, int y, int z, VolumeType volType)
 
virtual errcode Update () override
 Called every frame. More...
 
virtual errcode Draw () override
 Draw callback to override. More...
 
virtual errcode Collision (Frigate *)
 
virtual errcode Collision (flimSound *)
 
errcode SceneEntry () override
 Scene entry callback. More...
 
errcode SceneExit () override
 Scene exit callback. More...
 
- Public Member Functions inherited from GameObject
 GameObject ()
 
virtual ~GameObject ()
 
GameObjectoperator= (const GameObject &)=default
 
 GameObject (const GameObject &)=default
 
errcode SubmitEntry ()
 Submit entry to the scene. More...
 
errcode SubmitExit ()
 Submit exit to the scene. More...
 
- Public Member Functions inherited from Updatable
 Updatable ()
 
virtual ~Updatable ()
 
 Updatable (const Updatable &)=delete
 
const Updatableoperator= (const Updatable &)=delete
 
errcode SubmitUpdateRegistration ()
 Submit update registration. More...
 
errcode SubmitUpdateDeregistration ()
 Submit update deregistration. More...
 
- Public Member Functions inherited from Drawable
 Drawable ()
 
virtual ~Drawable ()
 
 Drawable (const Drawable &)=delete
 
const Drawableoperator= (const Drawable &)=delete
 
virtual errcode Draw2D ()
 
errcode SubmitDrawRegistration ()
 Submit draw registration. More...
 
errcode SubmitDrawDeregistration ()
 Submit draw deregistration. More...
 
std::list< Drawable * >::iterator GetDeletionIterator ()
 
errcode SetDeletionIterator (std::list< Drawable *>::iterator in)
 
- Public Member Functions inherited from Inputable
 Inputable ()
 
virtual ~Inputable ()
 
 Inputable (const Inputable &)=delete
 
const Inputableoperator= (const Inputable &)=delete
 
errcode SubmitInputRegistration (AZUL_KEY key, input_type type)
 Submit input registration. More...
 
errcode SubmitInputDeregistration (AZUL_KEY key, input_type type)
 Submit input deregistration. More...
 
std::list< Inputable * >::iterator GetDeletionIterator ()
 
errcode SetDeletionIterator (std::list< Inputable *>::iterator in)
 
- Public Member Functions inherited from Alarmable
 Alarmable ()
 
Alarmableoperator= (const Alarmable &)
 
virtual ~Alarmable ()
 
 Alarmable (const Alarmable &)
 
errcode SubmitAlarmDeregistration (AlarmableManager::ALARM_ID id)
 Submit alarm deregistration. More...
 
errcode SubmitAlarmRegistration (float t, AlarmableManager::ALARM_ID id)
 Submit alarm registration. More...
 
float TimeLeft (AlarmableManager::ALARM_ID id)
 Time left on one of the alarms. More...
 
errcode ChangeTime (float t, AlarmableManager::ALARM_ID id)
 Change time. More...
 
errcode AddTime (float t, AlarmableManager::ALARM_ID id)
 Adds a time to 'id'. More...
 
errcode SubtractTime (float t, AlarmableManager::ALARM_ID id)
 Subtract time. More...
 
bool IsRegistered (AlarmableManager::ALARM_ID id)
 Query if 'id' is registered. More...
 
errcode SetDeletionIter (int alarmNumber, std::multimap< float, AlarmableManager::AlarmEvent >::const_iterator iter)
 
std::multimap< float, AlarmableManager::AlarmEvent >::const_iterator GetDeletionIter (int alarmNumber)
 
errcode SetRegistrationState (int alarmNumber, RegistrationState state)
 
- Public Member Functions inherited from Collidable
 Collidable ()
 
virtual ~Collidable ()
 
 Collidable (const Collidable &)=delete
 
const Collidableoperator= (const Collidable &)=delete
 
virtual errcode Collision (Collidable *)
 Collision callback. More...
 
virtual errcode CollisionEnter (Collidable *)
 Collision enter. More...
 
virtual errcode CollisionExit ()
 Collision exit. More...
 
virtual errcode CollisionTerrain (const CollisionVolumeAABB &)
 Collision terrain. More...
 
template<typename C >
errcode SubmitCollisionRegistration (C *c)
 Submit collision registration of your type. More...
 
template<typename C >
errcode SubmitCollisionDeregistration (C *c)
 Submit collision deregistration for your type. More...
 
const CollisionVolumeGetCollisionVolume () const
 
errcode SetColliderModel (Model *mod, VolumeType vol)
 Sets collider model. More...
 
errcode UpdateCollisionData (Matrix &mat)
 Updates the collision data described by matrix. More...
 
std::list< Collidable * >::iterator GetDeletionIter ()
 
errcode SetDeletionIter (std::list< Collidable *>::iterator in)
 
bool getColliding () const
 
void setColliding (bool coll)
 
const CollisionVolumeBSpheregetBSphere () const
 

Private Member Functions

void Alarm0 () override
 Alarm 0 callback. More...
 
void Alarm1 () override
 Alarm 1 callback. More...
 
void Alarm2 () override
 Alarm 2 callback. More...
 
errcode KeyPressed (AZUL_KEY key) override
 Key pressed callback. More...
 
errcode KeyReleased (AZUL_KEY key) override
 Key released. More...
 

Private Attributes

GraphicsObject_TextureLight * pGObj_SpaceCottageLight
 
Matrix Scale
 
Vect Pos
 
Matrix Rot
 
const float ShipTransSpeed = 60
 
float TotalTime
 
float FrameTime
 
bool collided
 

Additional Inherited Members

- Public Attributes inherited from Updatable
std::list< Updatable * >::iterator deleteIter
 

Constructor & Destructor Documentation

◆ Cottage() [1/2]

Cottage::Cottage ( )

◆ Cottage() [2/2]

Cottage::Cottage ( const Cottage )
default

◆ ~Cottage()

Cottage::~Cottage ( )
virtual

Member Function Documentation

◆ Alarm0()

void Cottage::Alarm0 ( )
overrideprivatevirtual

Alarm 0 callback.

Author
Jack Campbell
Date
3/5/2017
Callback for alarms
{
DebugMsg::out("\n\nFIRST FRIGATE ALARMED\n\n");
}
{
DebugMsg::out("\n\nSECOND FRIGATE ALARMED\n\n");
}
{
DebugMsg::out("\n\nTHIRD FRIGATE ALARMED\n\n\n");
}

Reimplemented from Alarmable.

◆ Alarm1()

void Cottage::Alarm1 ( )
overrideprivatevirtual

Alarm 1 callback.

Author
Jack Campbell
Date
3/5/2017
see alarm0

Reimplemented from Alarmable.

◆ Alarm2()

void Cottage::Alarm2 ( )
overrideprivatevirtual

Alarm 2 callback.

Author
Jack Campbell
Date
3/5/2017
see alarm0

Reimplemented from Alarmable.

◆ Collision() [1/2]

virtual errcode Cottage::Collision ( Frigate )
inlinevirtual

◆ Collision() [2/2]

errcode Cottage::Collision ( flimSound )
virtual

◆ Draw()

errcode Cottage::Draw ( )
overridevirtual

Draw callback to override.

Author
Jack Campbell
Date
3/5/2017
This will be called once a frame and should only contain code related to rendering.
{
// Place rendering code here.
// Render ship's graphics object to the current main camera via the Scene
pGObj_SpaceFrigateLight->Render(&SceneManager::GetCurrentScene().GetCamera()->MainCamera());
}
Returns
An errcode.

Reimplemented from Drawable.

◆ Initialize() [1/2]

void Cottage::Initialize ( int  x,
int  y,
int  z 
)

◆ Initialize() [2/2]

void Cottage::Initialize ( int  x,
int  y,
int  z,
VolumeType  volType 
)

◆ KeyPressed()

errcode Cottage::KeyPressed ( AZUL_KEY  key)
overrideprivatevirtual

Key pressed callback.

Author
Jack Campbell
Date
3/5/2017
Parameters
keyHook to check the key.
Place code in this callback if you are registered for a press
event.
{
if (key == AZUL_KEY::KEY_SPACE)
{
DebugMsg::out("pressed\n");
}
}
Returns
An errcode.

Reimplemented from Inputable.

◆ KeyReleased()

errcode Cottage::KeyReleased ( AZUL_KEY  key)
overrideprivatevirtual

Key released.

Author
Jack Campbell
Date
3/5/2017
Parameters
keyHook to check the key.
Place code in this callback if you are registered for a release event.
{
if (key == AZUL_KEY::KEY_SPACE)
{
DebugMsg::out("released\n");
}
}
Returns
An errcode.

Reimplemented from Inputable.

◆ operator=()

const Cottage& Cottage::operator= ( const Cottage )
inline

◆ SceneEntry()

errcode Cottage::SceneEntry ( )
overridevirtual

Scene entry callback.

Author
Jack Campbell
Date
3/5/2017
This callback fires when a GameObject becomes active.
{
// Registration
// Setting graphics member variables
Matrix world;
ShipPos.set(0, 20, 0);
world = Matrix(TRANS, ShipPos);
pGObj_SpaceFrigateLight->SetWorld(world);
}
Returns
An errcode.

Reimplemented from GameObject.

◆ SceneExit()

errcode Cottage::SceneExit ( )
overridevirtual

Scene exit callback.

Author
Jack Campbell
Date
3/5/2017
This callback is called when a GameObject is deactivated.
Returns
An errcode.

Reimplemented from GameObject.

◆ Update()

errcode Cottage::Update ( )
overridevirtual

Called every frame.

Author
Jack Campbell
Date
3/5/2017
Update is called once a frame on objects that have been registered to update.
{
// Place frame related content here. This code moves the ship's graphics object.
// Ship translation movement (not using time-based values for simplicity)
if (Keyboard::GetKeyState(AZUL_KEY::KEY_W))
{
ShipPos += Vect(0, 0, 1) * ShipRot * ShipTransSpeed;
}
else if (Keyboard::GetKeyState(AZUL_KEY::KEY_S))
{
ShipPos += Vect(0, 0, 1) * ShipRot * -ShipTransSpeed;
}
// Spaceship adjust matrix
Matrix world = ShipScale * ShipRot * Matrix(TRANS, ShipPos);
pGObj_SpaceFrigateLight->SetWorld(world);
}
Returns
An errcode.

Reimplemented from Updatable.

Member Data Documentation

◆ collided

bool Cottage::collided
private

◆ FrameTime

float Cottage::FrameTime
private

◆ pGObj_SpaceCottageLight

GraphicsObject_TextureLight* Cottage::pGObj_SpaceCottageLight
private

◆ Pos

Vect Cottage::Pos
private

◆ Rot

Matrix Cottage::Rot
private

◆ Scale

Matrix Cottage::Scale
private

◆ ShipTransSpeed

const float Cottage::ShipTransSpeed = 60
private

◆ TotalTime

float Cottage::TotalTime
private

The documentation for this class was generated from the following files: