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 voidBeginContact(CollisionInfo info)Unusedvoidcreate(com.badlogic.gdx.math.Vector2 pos, java.lang.String name)Creates a building with the given name at the specified location.voiddestroy(Faction conqueror)Replace the building with ruins and mark as broken.voidEndContact(CollisionInfo info)UnusedvoidEnterTrigger(CollisionInfo info)Destroys the building and marks cannonball for removal.voidExitTrigger(CollisionInfo info)UnusedbooleanisAlive()- 
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:
 EnterTriggerin interfaceCollisionCallBack- Parameters:
 info- CollisionInfo container
 
- 
BeginContact
public void BeginContact(CollisionInfo info)
Unused- Specified by:
 BeginContactin interfaceCollisionCallBack
 
- 
EndContact
public void EndContact(CollisionInfo info)
Unused- Specified by:
 EndContactin interfaceCollisionCallBack
 
- 
ExitTrigger
public void ExitTrigger(CollisionInfo info)
Unused- Specified by:
 ExitTriggerin interfaceCollisionCallBack
 
 - 
 
 -