コード例 #1
0
ファイル: Village.cs プロジェクト: pkim/TravianBot
        public Village(IHPage _handlerPage, Int32 _id, String _name)
        {
            this.HPage = _handlerPage;

              this.ID = _id;
              this.Name = _name;

              this.Ressources = null;
              this.Buildings = new Dictionary<EBuildingType, IDictionary<Int32, IBuilding>>();
              this.Acceptance = new Double();
              this.DefenseBonus = new Double();
              this.Units = new Dictionary<EUnitType, IUnit>();
              this.Coordinate = null;
              this.URLFarm = HLink.GetLink(EPageID.FARM, _id);
              this.URLVillage = HLink.GetLink(EPageID.VILLAGE, _id);
              this.Inhabitants = new Int32();
              this.MainVillage = false;

              this.Initialized = false;
        }
コード例 #2
0
ファイル: Building.cs プロジェクト: pkim/TravianBot
        public Building(IHPage _pageHandler, Int32 _villageID, Int32 _id, String _name)
        {
            this.HPage = _pageHandler;

              this.VillageID = _villageID;
              this.ID        = _id;
              this.Name      = _name;

              // set type if dictionary contains configuration for the name
              try
              {
            this.Type = HInfo.PDictionary.Buildings[this.Name];
              }
              catch (Exception exception)
              {
            HInfo.LogHandler.Error(String.Format("The building name {0} isn't configured in the dictionary of building names. Unable to resovle type", this.Name), exception);
            throw;
              }

              // set detail link
              this.DetailLink = HLink.GetLink(EPageID.BUILDING, this.VillageID, this.ID);
        }