Пример #1
0
 internal void CancelConstruction()
 {
     if (this.IsConstructing)
     {
         bool wasUpgrading = IsUpgrading();
         this.IsConstructing = false;
         if (wasUpgrading)
         {
             SetUpgradeLevel(UpgradeLevel);
         }
         Construction_Item bd = GetConstructionItemData();
         Resource          rd = bd.GetBuildResource(UpgradeLevel + 1);
         int cost             = bd.GetBuildCost(UpgradeLevel + 1);
         int multiplier       = (CSV.Tables.Get(Gamefile.Globals).GetData("BUILD_CANCEL_MULTIPLIER") as Globals).NumberValue;
         int resourceCount    = (int)((cost * multiplier * (long)1374389535) >> 32);
         resourceCount = Math.Max((resourceCount >> 5) + (resourceCount >> 31), 0);
         //this.Level.CommodityCountChangeHelper(0, rd, resourceCount);
         //this.Level.WorkerManager.DeallocateWorker(this);
         if (UpgradeLevel == -1)
         {
             this.Level.GameObjectManager.RemoveGameObject(this);
         }
     }
 }
Пример #2
0
        internal Data Create(Row _Row)
        {
            Data _Data;

            switch (this.Index)
            {
            case 1:
                _Data = new Buildings(_Row, this);
                break;

            case 3:
                _Data = new Resource(_Row, this);
                break;

            case 4:
                _Data = new Characters(_Row, this);
                break;

            case 8:
                _Data = new Obstacles(_Row, this);
                break;

            case 11:
                _Data = new Experience_Levels(_Row, this);
                break;

            case 12:
                _Data = new Traps(_Row, this);
                break;

            case 14:
                _Data = new Globals(_Row, this);
                break;

            case 18:
                _Data = new Decos(_Row, this);
                break;

            case 21:
                _Data = new Missions(_Row, this);
                break;


            /*case 2:
             *  _Data = new Locales(_Row, this);
             *  break;
             * case 3:
             *  _Data = new Resources(_Row, this);
             *  break;
             * case 4:
             *  _Data = new Characters(_Row, this);
             *  break;
             * // case 5: Animation
             * case 6:
             *  _Data = new Projectiles(_Row, this);
             *  break;
             * case 7:
             *  _Data = new Building_Classes(_Row, this);
             *  break;
             * case 8:
             *  _Data = new Obstacles(_Row, this);
             *  break;
             * case 9:
             *  _Data = new Effects(_Row, this);
             *  break;
             * // case 10: Particle Emitters
             * case 11:
             *  _Data = new Experience_Levels(_Row, this);
             *  break;
             * case 12:
             *  _Data = new Traps(_Row, this);
             *  break;
             * case 13:
             *  _Data = new Alliance_Badges(_Row, this);
             *  break;
             * case 14:
             *  _Data = new Globals(_Row, this);
             *  break;
             * // case 15: TownHall Levels
             * case 16:
             *  _Data = new Alliance_Portal(_Row, this);
             *  break;
             * case 17:
             *  _Data = new Npcs(_Row, this);
             *  break;
             * case 18:
             *  _Data = new Decos(_Row, this);
             *  break;
             * // case 19: Resource Packs
             * case 20:
             *  _Data = new Shields(_Row, this);
             *  break;
             * // case 22: Billing Packages
             * case 23:
             *  _Data = new Achievements(_Row, this);
             *  break;
             * // case 24: Credits
             * // case 25: Faq
             * case 26:
             *  _Data = new Spells(_Row, this);
             *  break;
             * // case 27: Hints
             * case 28:
             *  _Data = new Heroes(_Row, this);
             *  break;
             * case 29:
             *  _Data = new Leagues(_Row, this);
             *  break;
             *
             * case 37:
             *  _Data = new Variables(_Row, this);
             *  break;
             */
            default:
            {
                _Data = new Data(_Row, this);
                break;
            }
            }

            return(_Data);
        }