X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FGame.cs;fp=CarFire%2FCarFire%2FCarFire%2FGame.cs;h=f78945b65d21fc85bf8fe94624d4b2af6b16b621;hp=1486e6572a66eb31db5b6413620342eb58efe85b;hb=08f41ef45f3c41ca6302150bc6d5270c8e7143db;hpb=60d05271b295d2ca94a0028059add525c1bbffb1 diff --git a/CarFire/CarFire/CarFire/Game.cs b/CarFire/CarFire/CarFire/Game.cs index 1486e65..f78945b 100644 --- a/CarFire/CarFire/CarFire/Game.cs +++ b/CarFire/CarFire/CarFire/Game.cs @@ -240,6 +240,11 @@ namespace CarFire #region Public Methods + /// + /// Get an entity at a certain place on the map. + /// + /// The coordinates. + /// The entity, or null if none is at that location. public IEntity GetEntityAtCoordinates(Point point) { foreach (IEntity entity in State.Entities) @@ -249,6 +254,11 @@ namespace CarFire return null; } + /// + /// Get a player at a certain place on the map. + /// + /// The coordinates. + /// The player, or null if none is at that location. public Player GetPlayerAtCoordinates(Point point) { foreach (Player player in State.mCharacters) @@ -258,6 +268,12 @@ namespace CarFire return null; } + /// + /// Determine if a cell is open, depending on the static scenery + /// of the map and if there are any collidable entities. + /// + /// The coordinates. + /// True if the cell is open; false otherwise. public bool IsCellOpen(Point point) { if (!State.Map.IsCellOpen(point)) return false; @@ -266,6 +282,37 @@ namespace CarFire return true; } + /// + /// Remove a specific entity from the game. The entity can still + /// be tracked some other way, but it won't included when the game is + /// updating and drawing stuff. + /// + /// The entity. + /// The entity that was removed, or null if no entity was removed. + public IEntity RemoveEntity(IEntity entity) + { + if (State.Entities.Remove(entity)) return entity; + return null; + } + + /// + /// Move on to the next map, and advance the level. + /// + public void AdvanceLevel() + { + // TODO: Load the next map, etc... + } + + /// + /// Restart the current level. + /// + public void Reset() + { + State.Map.Reset(); + // TODO: Do other stuff to reset everything. + } + + public Game() {