Exemple #1
0
        public void TestInitialize()
        {
            this.travianData = new Data()
            {
                Server   = "none",
                Username = "******"
            };

            Dictionary <string, string> Options = new Dictionary <string, string>();

            this.travian = new Travian(travianData, Options);

            this.villageID = 1;
            this.village   = new TVillage();
            this.travianData.Villages[villageID] = village;

            this.village.Name = "Home";
            this.village.isTroopInitialized = 2;
            this.village.Troop = this.troop = new TTroop();
            int[] troopsAtHome = new int[11];
            troopsAtHome[0] = 8;
            TTInfo troopAtHome = new TTInfo
            {
                Troops      = troopsAtHome,
                Owner       = this.village.Name,
                TroopType   = TTroopType.InVillage,
                VillageName = "Own troops"
            };

            this.troop.Troops.Add(troopAtHome);

            int[] troopsOnTheRood = new int[11];
            troopsOnTheRood[0] = 5;
            TTInfo troopOnTheRoad = new TTInfo
            {
                Troops      = troopsAtHome,
                TroopType   = TTroopType.MyReturnWay,
                FinishTime  = DateTime.Now.AddSeconds(100),
                VillageName = "Raid on abc Village"
            };

            this.troop.Troops.Add(troopOnTheRoad);

            this.troops    = new int[11];
            this.troops[0] = 5;

            this.targets = new List <TPoint>();
            this.targets.Add(new TPoint(1, 2));
            this.targets.Add(new TPoint(0, 0));

            this.target = new RaidQueue()
            {
                UpCall    = this.travian,
                VillageID = this.villageID,
                Troops    = this.troops,
                Targets   = this.targets,
                RaidType  = RaidType.AttackRaid,
            };

            this.pageQuerier         = new MockPageQuerier(this.villageID);
            this.travian.pageQuerier = pageQuerier;
        }
Exemple #2
0
        public void TestInitialize()
        {
            this.travianData = new Data()
            {
                Server = "none",
                Username = "******"
            };

            Dictionary<string, string> Options = new Dictionary<string, string>();
            this.travian = new Travian(travianData, Options, "cn");

            this.villageID = 1;
            this.village = new TVillage();
            this.travianData.Villages[villageID] = village;

            this.village.Name = "Home";
            this.village.isTroopInitialized = 2;
            this.village.Troop = this.troop = new TTroop();
            int[] troopsAtHome = new int[11];
            troopsAtHome[0] = 8;
            TTInfo troopAtHome = new TTInfo
            {
                Troops = troopsAtHome,
                Owner = this.village.Name,
                TroopType = TTroopType.InVillage,
                VillageName = "Own troops"
            };
            this.troop.Troops.Add(troopAtHome);

            int[] troopsOnTheRood = new int[11];
            troopsOnTheRood[0] = 5;
            TTInfo troopOnTheRoad = new TTInfo
            {
                Troops = troopsAtHome,
                TroopType = TTroopType.MyReturnWay,
                FinishTime = DateTime.Now.AddSeconds(100),
                VillageName = "Raid on abc Village"
            };
            this.troop.Troops.Add(troopOnTheRoad);

            this.troops = new int[11];
            this.troops[0] = 5;

            this.targets = new List<TPoint>();
            this.targets.Add(new TPoint(1, 2));
            this.targets.Add(new TPoint(0, 0));

            this.target = new RaidQueue()
            {
                UpCall = this.travian,
                VillageID = this.villageID,
                Troops = this.troops,
                Targets = this.targets,
                RaidType = RaidType.AttackRaid,
            };

            this.pageQuerier = new MockPageQuerier(this.villageID);
            this.travian.pageQuerier = pageQuerier;
        }