コード例 #1
0
ファイル: NatureResource.cs プロジェクト: yuri410/lrvbsvnicg
        public override void Parse(GameConfigurationSection sect)
        {
            base.Parse(sect);

            string type = sect.GetString("Type", string.Empty).ToLowerInvariant();
            if (type == "wood")
            {
                this.Type = NaturalResourceType.Wood;
            }
            else if (type == "petro")
            {
                this.Type = NaturalResourceType.Oil;
            }


            CurrentAmount = sect.GetSingle("Amount", 0);
            //MaxAmount = CurrentAmount * FTimesMaxAmount;

            UpdateLocation();

            Reset(CurrentAmount);
        }
コード例 #2
0
ファイル: City.cs プロジェクト: yuri410/lrvbsvnicg
        public override void Parse(GameConfigurationSection sect)
        {
            base.Parse(sect);
            this.Name = sect.GetString("Name", string.Empty);

            StartUp = sect.GetInt("StartUp", -1);

            linkableCityName = sect.GetStringArray("Linkable", null);

            development = sect.GetSingle("InitialDevelopment", RulesTable.CityInitialDevelopment);
            healthValue = CurrentMaxHealth;




            float facing = MathEx.PIf + (Randomizer.GetRandomSingle() - 0.5f) * MathEx.PiOver2;
            //currentFacing =  MathEx.PIf * (5f / 6 + Randomizer.GetRandomSingle() / 3);
            currentFacing = Quaternion.RotationAxis(Vector3.UnitY, facing);

            UpdateLocation();
        }