// --- Constructors --- public AttackDecisionGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap) { gstate= pmGState; game= pmGame; map= pmMap; background= new Control(game); leftPanel= new Control(game); rightPanel= new Control(game); lpName= new Label(game); lpStats= new Label[8]; for(int i= 0; i< lpStats.Length; i++) lpStats[i]= new Label(game); rpName= new Label(game); rpStats= new Label[8]; for(int i= 0; i< rpStats.Length; i++) rpStats[i]= new Label(game); accuracyLbl= new Label(game); accuracy= new Label(game); critLbl= new Label(game); crit= new Label(game); dmgLbl= new Label(game); dmg= new Label(game); commit= new Button(game); cancel= new Button(game); }
// --- Constructors --- public BattleMap(ref GameExt pmGame, GSGameplay pmGState, int pmWidth, int pmHeight) { game= pmGame; gstate= pmGState; tiles= new Grid<Tile>(pmWidth, pmHeight); teams= new List<Team>(); currTeamID= -1; currUnitID= 0; bGameOver= false; psystem= new ParticleSystem(); allowPlayerInput= true; }
// --- Static Methods --- // Creates a map from a bitmap public static BattleMap createFromBitmap(string filename, ref GameExt game, GSGameplay gstate) { // Variables Sdx.Bitmap bitmap= new Sdx.Bitmap(filename); BattleMap map= new BattleMap(ref game, gstate, bitmap.Width, bitmap.Height); for(int h= 0; h< map.width; h++) { for(int k= 0; k< map.height; k++) { map.tiles.items[h, k].item= Tile.getTileFromColor(bitmap.GetPixel(h, k), h, k, ref game, map); } } return map; }