示例#1
0
        public GUIWindow()
        {
            InitializeComponent();
            imageX = 30;
            imageY = 30;
            game = new Game();
               // dungeon = new Dungeon();
            dungeon = Dungeon.getInstance();

            v = new DisplayView(this, dungeon);
            battle = new BattleSystem(v);
            dungeon.SetView(v);
            game = new Game(dungeon, v, battle);
            dungeon.SetGame(game);
        }
示例#2
0
 public void SetGame(Game g)
 {
     mGame = g;
 }
示例#3
0
        // Methods
        public static Dungeon getInstance(Game game)
        {
            if (mDungeon == null)
                mDungeon = new Dungeon(game);

            return mDungeon;
        }
示例#4
0
        // reference needed to give items to party;
        // Constructors
        private Dungeon( Game game )
        {
            mGame = game;

            // This is going to be a set size for the grid.
               // mGrid = new Grid(5, 5);

            // Create static grid array.
            staticGrid = new DungeonEnum[5, 5] { {DungeonEnum.FREESPACE, DungeonEnum.WALL, DungeonEnum.ITEM, DungeonEnum.ITEM, DungeonEnum.ITEM},
                                                 {DungeonEnum.ITEM, DungeonEnum.FREESPACE, DungeonEnum.WALL, DungeonEnum.FREESPACE, DungeonEnum.WALL},
                                                 {DungeonEnum.FREESPACE, DungeonEnum.FREESPACE, DungeonEnum.ITEM, DungeonEnum.FREESPACE, DungeonEnum.ITEM},
                                                 {DungeonEnum.WALL, DungeonEnum.ITEM, DungeonEnum.WALL, DungeonEnum.FREESPACE, DungeonEnum.WALL},
                                                 {DungeonEnum.ITEM, DungeonEnum.FREESPACE, DungeonEnum.ITEM, DungeonEnum.ITEM, DungeonEnum.FREESPACE}};

            mGrid = new Grid(5, 5, staticGrid);

            // Keeps track of the location of players on 5 by 5 gird.
            //playerLocation = new int[5, 5];
            playerLocationRow = 0;
            playerLocationColumn = 0;

            // Player begin at top left corner of grid.
            //playerLocation[0, 0] = 1;

            // Set starting tile and dragon tile
            Tile[,] sTiles = mGrid.GetTiles();

            // Set the dragon image on last tile
            sTiles[4, 4].TileType = DungeonEnum.DRAGON;

            // Make sure that the first tile is a freespace
            sTiles[0, 0].TileType = DungeonEnum.FREESPACE;
        }
示例#5
0
 // Constructors
 public BattleSystem(Game currentGame)
 {
     mGame = currentGame;
 }
示例#6
0
 // Constructors
 public Battle(Game currentGame, Party goodGuyParty)
 {
     mGame = currentGame;
     mGoodGuys = goodGuyParty;
 }