Package com.mygdx.game.Entitys
Class Building
- java.lang.Object
-
- com.mygdx.game.Entitys.Entity
-
- com.mygdx.game.Entitys.Building
-
- All Implemented Interfaces:
CollisionCallBack
public class Building extends Entity implements CollisionCallBack
Buildings that you see in game. Changed for Assessment 2 (made class public)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
BeginContact(CollisionInfo info)
Unusedvoid
create(com.badlogic.gdx.math.Vector2 pos, java.lang.String name)
Creates a building with the given name at the specified location.void
destroy(Faction conqueror)
Replace the building with ruins and mark as broken.void
EndContact(CollisionInfo info)
Unusedvoid
EnterTrigger(CollisionInfo info)
Destroys the building and marks cannonball for removal.void
ExitTrigger(CollisionInfo info)
Unusedboolean
isAlive()
-
Methods inherited from class com.mygdx.game.Entitys.Entity
addComponent, addComponents, cleanUp, dispose, getComponent, getComponent, getName, raiseEvents, setName, update
-
-
-
-
Constructor Detail
-
Building
public Building(College college)
Flags are indestructible and mark college locations. Amended for Assessment 2: Added College parameter to keep track of parent- Parameters:
college
- added to signify ownership of building
-
-
Method Detail
-
create
public void create(com.badlogic.gdx.math.Vector2 pos, java.lang.String name)
Creates a building with the given name at the specified location.- Parameters:
pos
- 2D position vectorname
- name of building
-
destroy
public void destroy(Faction conqueror)
Replace the building with ruins and mark as broken. Changed for Assessment 2 - Made public for testing purposes - Sets destroyer as parent college's most recent attacker.
-
isAlive
public boolean isAlive()
- Returns:
- the boolean value of the alive status of the Pirate Component
-
EnterTrigger
public void EnterTrigger(CollisionInfo info)
Destroys the building and marks cannonball for removal. Amended for Assessment 2, added Faction checks and now ignores flags- Specified by:
EnterTrigger
in interfaceCollisionCallBack
- Parameters:
info
- CollisionInfo container
-
BeginContact
public void BeginContact(CollisionInfo info)
Unused- Specified by:
BeginContact
in interfaceCollisionCallBack
-
EndContact
public void EndContact(CollisionInfo info)
Unused- Specified by:
EndContact
in interfaceCollisionCallBack
-
ExitTrigger
public void ExitTrigger(CollisionInfo info)
Unused- Specified by:
ExitTrigger
in interfaceCollisionCallBack
-
-