flimEngine
Frigate Class Reference

#include <Frigate.h>

Inheritance diagram for Frigate:
Inheritance graph
Collaboration diagram for Frigate:
Collaboration graph

Public Member Functions

 Frigate ()
 
 Frigate (const Frigate &)
 
virtual ~Frigate ()
 
const Frigateoperator= (const Frigate &)
 
void Initialize (int x, int y, int z)
 
virtual errcode Update () override
 Called every frame. More...
 
virtual errcode Draw () override
 Draw callback to override. More...
 
virtual errcode Draw2D () override
 
virtual errcode Collision (Frigate *)
 
virtual errcode Collision (Cottage *)
 
virtual errcode Collision (Enemy *)
 
virtual errcode CollisionTerrain (const CollisionVolumeAABB &) override
 Collision terrain. More...
 
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
 
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...
 
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_SpaceFrigateLight
 
Matrix ShipScale
 
Vect ShipPos
 
Matrix ShipRot
 
const float ShipTransSpeed = 2.5f
 
const float ShipRotAng = .05f
 
float TotalTime
 
float FrameTime
 
FlimTerrainterrain
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Frigate() [1/2]

Frigate::Frigate ( )

◆ Frigate() [2/2]

Frigate::Frigate ( const Frigate )
inline

◆ ~Frigate()

Frigate::~Frigate ( )
virtual

Member Function Documentation

◆ Alarm0()

void Frigate::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 Frigate::Alarm1 ( )
overrideprivatevirtual

Alarm 1 callback.

Author
Jack Campbell
Date
3/5/2017
see alarm0

Reimplemented from Alarmable.

◆ Alarm2()

void Frigate::Alarm2 ( )
overrideprivatevirtual

Alarm 2 callback.

Author
Jack Campbell
Date
3/5/2017
see alarm0

Reimplemented from Alarmable.

◆ Collision() [1/3]

virtual errcode Frigate::Collision ( Frigate )
inlinevirtual

◆ Collision() [2/3]

virtual errcode Frigate::Collision ( Cottage )
inlinevirtual

◆ Collision() [3/3]

virtual errcode Frigate::Collision ( Enemy )
inlinevirtual

◆ CollisionTerrain()

virtual errcode Frigate::CollisionTerrain ( const CollisionVolumeAABB )
inlineoverridevirtual

Collision terrain.

Author
Jack Campbell
Date
6/1/2017
Parameters
parameter1The first parameter.
Returns
An errcode.

Reimplemented from Collidable.

◆ Draw()

errcode Frigate::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.

◆ Draw2D()

errcode Frigate::Draw2D ( )
overridevirtual

Reimplemented from Drawable.

◆ Initialize()

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

◆ KeyPressed()

errcode Frigate::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 Frigate::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 Frigate& Frigate::operator= ( const Frigate )
inline

◆ SceneEntry()

errcode Frigate::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 Frigate::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 Frigate::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

◆ FrameTime

float Frigate::FrameTime
private

◆ pGObj_SpaceFrigateLight

GraphicsObject_TextureLight* Frigate::pGObj_SpaceFrigateLight
private

◆ ShipPos

Vect Frigate::ShipPos
private

◆ ShipRot

Matrix Frigate::ShipRot
private

◆ ShipRotAng

const float Frigate::ShipRotAng = .05f
private

◆ ShipScale

Matrix Frigate::ShipScale
private

◆ ShipTransSpeed

const float Frigate::ShipTransSpeed = 2.5f
private

◆ terrain

FlimTerrain* Frigate::terrain
private

◆ TotalTime

float Frigate::TotalTime
private

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