示例#1
0
        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);
        }
示例#2
0
 public void GoToRoom(CreateRoomDelegate factory)
 {
     PreviousRoom = CurrentRoom;
     if (PreviousRoom != null)
         CleanupPreviousRoom();
     CurrentRoom = factory(this);
     ReturnRoom = null;
 }
示例#3
0
        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);
        }
示例#4
0
 public void ReturnToRoom()
 {
     PreviousRoom = CurrentRoom;
     CurrentRoom = ReturnRoom;
     ReturnRoom = null;
 }
示例#5
0
 public void GoToRoomThenReturn(CreateRoomDelegate factory, RoomBase returnRoom)
 {
     PreviousRoom = CurrentRoom;
     CurrentRoom = factory(this);
     ReturnRoom = returnRoom;
 }
示例#6
0
 private void InitializeRooms()
 {
     PreviousRoom = null;
     CurrentRoom = null;
     ReturnRoom = null;
 }
示例#7
0
        private void CleanupRooms()
        {
            if (PreviousRoom != null)
            {
                PreviousRoom.Dispose();
                PreviousRoom = null;
            }

            if (CurrentRoom != null)
            {
                CurrentRoom.Dispose();
                CurrentRoom = null;
            }

            if (ReturnRoom != null)
            {
                ReturnRoom.Dispose();
                ReturnRoom = null;
            }
        }
示例#8
0
        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);
 }
示例#10
0
 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)
 {
 }