Ejemplo n.º 1
0
        public void InitUnits()
        {
            int ID = 0;
            foreach (var item in m_lPlayerList)
            {

                for (int i = 0; i < 5; i++)
                {
                    Unit u = new Unit();
                    Unit tempUnit = u.CreateSoldier(item.playerHouse);
                    ID++;
                    tempUnit.ID = ID;

                    switch (item.playerHouse)
                    {
                        case HOUSE.GREYJOY:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.LANNISTER:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.TYRELL:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.STARKS:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.BARATHEON:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.MARTELL:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.NONE:
                            new Exception("hiba line: 1316");
                            break;
                        default:
                            break;
                    }

                    m_lUnitsList.Add(tempUnit);
                }

                for (int i = 0; i < 3; i++)
                {
                    Unit u = new Unit();
                    Unit tempUnit = u.CreateKnight(item.playerHouse);
                    ID++;
                    tempUnit.ID = ID;


                    switch (item.playerHouse)
                    {
                        case HOUSE.GREYJOY:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.LANNISTER:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.TYRELL:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.STARKS:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.BARATHEON:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.MARTELL:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.NONE:
                            new Exception("hiba line: 1316");
                            break;
                        default:
                            break;
                    }

                    m_lUnitsList.Add(tempUnit);

                }

                for (int i = 0; i < 2; i++)
                {
                    Unit u = new Unit();
                    Unit tempUnit = u.CreateMachine(item.playerHouse);
                    ID++;
                    tempUnit.ID = ID;

                    switch (item.playerHouse)
                    {
                        case HOUSE.GREYJOY:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.LANNISTER:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.TYRELL:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.STARKS:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.BARATHEON:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.MARTELL:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.NONE:
                            new Exception("hiba line: 1316");
                            break;
                        default:
                            break;
                    }

                    m_lUnitsList.Add(tempUnit);
                }

                for (int i = 0; i < 4; i++)
                {
                    Unit u = new Unit();
                    Unit tempUnit = u.CreateShip(item.playerHouse);
                    ID++;
                    tempUnit.ID = ID;

                    switch (item.playerHouse)
                    {
                        case HOUSE.GREYJOY:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.LANNISTER:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.TYRELL:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.STARKS:
                            {//kesz
                                RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.BARATHEON:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.MARTELL:
                            {
                                RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD };
                                Random rnd = new Random();
                                RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())];
                                tempUnit.position = findRegionByName(next);
                            }
                            break;
                        case HOUSE.NONE:
                            new Exception("hiba line: 1316");
                            break;
                        default:
                            break;
                    }

                    m_lUnitsList.Add(tempUnit);

                }

            }
        }