public Background(RoomBase room, Int32 columns, Int32 rows, String asset, Int32 assetColumns, Int32 assetRows, Int32 tileWidth, Int32 tileHeight) { if (room == null) throw new ArgumentNullException(); Initialize(room, columns, rows, asset, assetColumns, assetRows, tileWidth, tileHeight); }
public void GoToRoom(CreateRoomDelegate factory) { PreviousRoom = CurrentRoom; if (PreviousRoom != null) CleanupPreviousRoom(); CurrentRoom = factory(this); ReturnRoom = null; }
public Actor(RoomBase room, String spriteSrc, Vector2 position, Single mass, Single damping) : base(position, mass, damping) { if (room == null) throw new ArgumentNullException(); if (String.IsNullOrWhiteSpace(spriteSrc)) throw new ArgumentNullException(); Room = room; Initialize(spriteSrc); }
public void ReturnToRoom() { PreviousRoom = CurrentRoom; CurrentRoom = ReturnRoom; ReturnRoom = null; }
public void GoToRoomThenReturn(CreateRoomDelegate factory, RoomBase returnRoom) { PreviousRoom = CurrentRoom; CurrentRoom = factory(this); ReturnRoom = returnRoom; }
private void InitializeRooms() { PreviousRoom = null; CurrentRoom = null; ReturnRoom = null; }
private void CleanupRooms() { if (PreviousRoom != null) { PreviousRoom.Dispose(); PreviousRoom = null; } if (CurrentRoom != null) { CurrentRoom.Dispose(); CurrentRoom = null; } if (ReturnRoom != null) { ReturnRoom.Dispose(); ReturnRoom = null; } }
private void Initialize(RoomBase room, Int32 columns, Int32 rows, String asset, Int32 assetColumns, Int32 assetRows, Int32 tileWidth, Int32 tileHeight) { Room = room; Asset = asset; AssetColumns = assetColumns; AssetRows = assetRows; AssetTileWidth = tileWidth; AssetTileHeight = tileHeight; Columns = columns; Rows = rows; Width = Columns * AssetTileWidth; Height = Rows * AssetTileHeight; InitializeSpriteList(); InitializeSprites(); InitializeTiles(); }