public BackgroundBase(RoomBase room, Int32 columns, Int32 rows, String asset, Int32 assetColumns, Int32 assetRows, Int32 tileWidth, Int32 tileHeight, Int32 horizontalScreenPadding, Int32 verticalScreenPadding) { if (room == null) throw new ArgumentNullException(); Initialize(room, columns, rows, asset, assetColumns, assetRows, tileWidth, tileHeight, horizontalScreenPadding, verticalScreenPadding); }
public void GoToRoom(CreateRoomDelegate factory) { PreviousRoom = CurrentRoom; if (PreviousRoom != null) CleanupPreviousRoom(); CurrentRoom = factory(this); ReturnRoom = null; }
public Actor(RoomBase room, String spriteSrc, Vector2 position) { 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, Int32 horizontalScreenPadding, Int32 verticalScreenPadding) { Room = room; Asset = asset; AssetColumns = assetColumns; AssetRows = assetRows; AssetTileWidth = tileWidth; AssetTileHeight = tileHeight; HorizontalScreenPadding = horizontalScreenPadding; VerticalScreenPadding = verticalScreenPadding; Columns = columns; Rows = rows; CalcDimensions(); InitializeSpriteList(); InitializeSprites(); InitializeTiles(); }
public static BackgroundBase DiamondBackgroundFactory(RoomBase room, Int32 columns, Int32 rows, String asset, Int32 assetColumns, Int32 assetRows, Int32 tileWidth, Int32 tileHeight, Int32 horizontalScreenPadding, Int32 verticalScreenPadding) { return new DiamondBackground(room, columns, rows, asset, assetColumns, assetRows, tileWidth, tileHeight, horizontalScreenPadding, verticalScreenPadding); }
public DiamondBackground(RoomBase room, Int32 columns, Int32 rows, String asset, Int32 assetColumns, Int32 assetRows, Int32 tileWidth, Int32 tileHeight, Int32 horizontalScreenPadding, Int32 verticalScreenPadding) : base(room, columns, rows, asset, assetColumns, assetRows, tileWidth, tileHeight, horizontalScreenPadding, verticalScreenPadding) { }