public Game(Dungeon dungeon, View view, BattleSystem battle) { /* start constructor */ mDungeon = dungeon; mView = view; mBattle = battle; initialize(); }
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); }
// public View() // Load the images from the Resource here to put into the tiles. // Constructors // public View() // { // } //public View(Graphics g, GUIWindow form) public DisplayView(GUIWindow form, Dungeon dungeon) { //g.DrawLine(new Pen(Brushes.Black, 5), 0, 0, 200, 200); // graphics = g; // partyImage = Image.FromFile( Directory.GetCurrentDirectory() + @"\images\party2.png"); partyImage = Properties.Resources.party2; // Load all images for the tiles here. // Directory.GetCurrentDirectory() + @"\images\treasure00.png" treasureItemImage = Properties.Resources.treasure00; dragonImage = Properties.Resources.dragon; wall = Properties.Resources.wall; wall2 = Properties.Resources.wall2; // SetupView(d); imageX = 30; imageY = 30; viewWindow = form; //d = new Dungeon(); d = dungeon; }
public static Dungeon getInstance() { if (mDungeon == null) mDungeon = new Dungeon(); return mDungeon; }
// Methods public static Dungeon getInstance(Game game) { if (mDungeon == null) mDungeon = new Dungeon(game); return mDungeon; }
private void initialize() { /* start initialize */ ClassEnum choice; int i; String name; Character[] characters = new Character[ Party.MAXPARTY ]; // mView = new TextView(); mDungeon = Dungeon.getInstance(this); mView = new DisplayView(viewWindow, mDungeon); //for (i = 0; i < Party.MAXPARTY; i++) for (i = 0; i < 1; i++) {/* start loop */ choice = mView.getClassChoice(); name = mView.getCharacterName(); characters[ i ] = CharacterFactory.getInstance().getCharacter(choice, name); }/* end loop */ mGoodGuys = new Party(characters); // mView.GoodGuys = mGoodGuys; mBattle = new Battle(this, mGoodGuys); mDungeon.SetView(mView); mDungeon.SetGame(this); //mView.Dungeon = mDungeon.Grid; }