Exemplo n.º 1
0
        private bool FillFleet(ItemsTable table, Chronos.Core.Fleet f1, string type)
        {
            ArrayList unitNames = (ArrayList)allUnits[type];

            for (int i = 0; i < unitNames.Count; ++i)
            {
                string textBoxText = table.getSpecificText(i, 2);
                if (string.Empty == textBoxText)
                {
                    continue;
                }

                string unit = unitNames[i].ToString( );

                try {
                    if (OrionGlobals.isInt(textBoxText.ToString()))
                    {
                        //Resource r = GetUnitResource(unit,"Unit");
                        int quant = int.Parse(textBoxText.ToString());
                        if (0 == quant)
                        {
                            continue;
                        }
                        f1.addShip(unit, quant);
                    }
                    else
                    {
                        Information.AddError(info.getContent("battle_noInt"));
                        return(false);
                    }
                }catch (OverflowException) {
                    Information.AddError(string.Format(info.getContent("battle_IntToBig"), unit));
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
 private Tournament GenerateSampleTournament()
 {
     Chronos.Core.Fleet fleet = new Chronos.Core.Fleet("TournamentFleet", Coordinate.First, null, false);
     fleet.addShip("Rain", 100 );
     return new Tournament(TournamentType, fleet);
 }
Exemplo n.º 3
0
 private Tournament GenerateSampleTournament()
 {
     Chronos.Core.Fleet fleet = new Chronos.Core.Fleet("TournamentFleet", Coordinate.First, null, false);
     fleet.addShip("Rain", 100);
     return(new Tournament(TournamentType, fleet));
 }