public ArenaWindow(Window w, Arena_Impl arenaImpl, Fighter_Impl pImpl)
        {
            this.pImpl = pImpl;

            this.arenaImpl = arenaImpl;
            this.w         = w;

            //is triggered when coming from prefield window
            if (w is PreBattleFieldWindow)
            {
                backtrack = true;
            }

            InitializeComponent();

            //ALREADY CREATED ARENA IN PREARENA
            //Creates the playground (currently of 6,6)
            CreateArena();

            //Adds prefieldbattle team to list and adds them to their respective fields on the battleField
            InsertParticipantsToField();

            ListOfParticipants.SelectedIndex = 0;
            Fighter_DTO firstFighter = pImpl.GetParticipant(ListOfParticipants.SelectedValue.ToString()); //is allowed due to not otherwize being able to access it.

            if (firstFighter.TeamColorGS.Equals("blue"))                                                  //only triggered if the first fighter is Horde
            {
                xCoord.IsHitTestVisible = false;
                yCoord.IsHitTestVisible = false;
                PlayingDisplayBox.Text  = hordeTxt;
                CheckNextParticipant();
            }
        }
Esempio n. 2
0
        public PreBattleFieldWindow(MainWindow mw, Fighter_Impl pImpl, Arena_Impl arenaImpl, Team_Impl tImpl)
        {
            this.ArenaImpl = arenaImpl;

            this.pImpl = pImpl;
            this.mw    = mw;
            this.tImpl = tImpl;
            Closed    += new EventHandler(App_exit); //subscribing to closed event
            exitApp    = true;                       //used for closing app
            InitializeComponent();
            CreatePreArena();
            ShowTeamList();
        }
Esempio n. 3
0
        public MainWindow()
        {
            //Data layer creation
            Team_DAO        team_DB = new Team_DAO();
            Arena_DAO       A_DAO   = new Arena_DAO();
            Participant_DAO pDAO    = new Participant_DAO();

            //Implementation layer creation
            arena_Impl   = new Arena_Impl(A_DAO);
            fighter_Impl = new Fighter_Impl(pDAO, team_DB, arena_Impl);
            team_Impl    = new Team_Impl(team_DB);

            //this is to prevent the gui from reaching down into the DAOS, so we hand the DAOS to the implementation and then the implementation to the GUI

            InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            String[] colors =
            {
                "PINK",
                "TEAL",
                "RED",
                "GREEN",
                "ORANGE",
                "YELLOW"
            };

            #region create two teams
            Fighter_DTO pDTO = new Fighter_DTO(); //Only used within this method
            //Creates an enemy team of 6
            team_Impl.AddEnemyTeam("Horde", "1");
            for (int i = 0; i < 6; i++)
            {
                pDTO = new Fighter_DTO(100, 4, 4, 2, "HordeGrunt-" + colors[i], "Horde", "a", "b", "c", "d", "e", "f");
                fighter_Impl.AddParticipantToList(pDTO);
            }
            //creates ally team and enemy team
            team_Impl.AddAllyTeam("Alliance", "1");
            for (int i = 0; i < 6; i++)
            {
                pDTO = new Fighter_DTO(100, 4, 4, 2, "AllianceWarrior - " + colors[i], "Alliance", "a", "b", "c", "d", "e", "f");
                fighter_Impl.AddParticipantToList(pDTO);
            }
            #endregion
            //add participantSkins to game
            #region skins
            //Adds possible player images.
            Storage.AllianceSkins.Add("AlliancePinkPlayer.png");
            Storage.AllianceSkins.Add("AllianceTealPlayer.png");
            Storage.AllianceSkins.Add("AllianceRedPlayer.png");
            Storage.AllianceSkins.Add("AllianceGreenPlayer.png");
            Storage.AllianceSkins.Add("AllianceOrangePlayer.png");
            Storage.AllianceSkins.Add("AllianceYellowPlayer.png");
            Storage.HordeSkins.Add("HordePinkPlayer.png");
            Storage.HordeSkins.Add("HordeTealPlayer.png");
            Storage.HordeSkins.Add("HordeRedPlayer.png");
            Storage.HordeSkins.Add("HordeGreenPlayer.png");
            Storage.HordeSkins.Add("HordeOrangePlayer.png");
            Storage.HordeSkins.Add("HordeYellowPlayer.png");
            #endregion
        }