public static bool Add(int gridColumn,int gridRow, GameplayObject componentToAdd) { if(BoardManager.IsCoordValid(gridColumn,gridRow)) { return s_board[gridColumn, gridRow].Register(componentToAdd); } return false; }
public static bool AddIfUnblocked(int gridColumn, int gridRow, GameplayObject componentToAdd) { if (BoardManager.IsCoordValid(gridColumn, gridRow)) { if (!s_board[gridColumn, gridRow].IsBlocked()) { s_board[gridColumn, gridRow].Register(componentToAdd); return true; } } return false; }
public static bool AddIfUnblocked(GameplayObject component) { return AddIfUnblocked((int)component.GetPosition().X, (int)component.GetPosition().Y, component); }
public static bool Add(GameplayObject componentToAdd) { return Add((int)componentToAdd.GetPosition().X, (int)componentToAdd.GetPosition().Y, componentToAdd); }
public bool Unregister(GameplayObject component) { switch (component.GetAssetType()) { case SpriteType.BOMB: m_drawableComponents.Remove(m_bomb); m_bomb = null; break; case SpriteType.PLAYER_WALK: m_drawableComponents.Remove(m_player); m_player = null; break; case SpriteType.PLAYER_STAND: m_drawableComponents.Remove(m_player); m_player = null; break; case SpriteType.DIRT_FLOOR: m_drawableComponents.Remove(m_environmentTile); m_environmentTile = null; break; case SpriteType.EXPLOSION: m_drawableComponents.Remove(m_explosion); m_explosion = null; break; case SpriteType.WALL: m_drawableComponents.Remove(m_wall); m_wall = null; break; case SpriteType.CRATE: m_drawableComponents.Remove(m_crate); m_crate = null; break; case SpriteType.POWERUP: m_drawableComponents.Remove(m_powerup); m_powerup = null; break; default: throw new Exception("An unhandled type was detected in BoardTile."); } //Console.Write(GetDebugLog()); return true; }
public bool Register(GameplayObject component) { if (!Contains(component.GetAssetType())) { switch (component.GetAssetType()) { case SpriteType.BOMB: m_bomb = (Bomb)component; m_drawableComponents.Add(m_bomb); break; case SpriteType.PLAYER_WALK: m_player = (Player)component; m_drawableComponents.Add(m_player); break; case SpriteType.PLAYER_STAND: m_player = (Player)component; m_drawableComponents.Add(m_player); break; case SpriteType.DIRT_FLOOR: m_environmentTile = (EnvironmentTile)component; m_drawableComponents.Add(m_environmentTile); break; case SpriteType.EXPLOSION: if (!IsTypeRegistered(SpriteType.WALL)) { m_explosion = (Explosion)component; m_drawableComponents.Add(m_explosion); } break; case SpriteType.WALL: m_wall = (Wall)component; m_drawableComponents.Add(m_wall); break; case SpriteType.CRATE: m_crate = (Crate)component; m_drawableComponents.Add(m_crate); break; case SpriteType.POWERUP: m_powerup = (Powerup)component; m_drawableComponents.Add(m_powerup); break; default: throw new Exception("An unhandled type was detected in BoardTile."); } return true; } return false; //Console.Write(GetDebugLog()); }