コード例 #1
0
    public Action(string a, GameObject str) {

        Do = a;

        if (str.GetComponent<StorageBuilding>() != null)
            data = new StorageBuildingSave(str);

        else if (str.GetComponent<Stable>() != null)
            data = new StableSave(str);

		else if (str.GetComponent<Crop>() != null)
			data = new CropSave(str);

		else if (str.GetComponent<Generator>() != null)
            data = new GeneratorSave(str);

        else if (str.GetComponent<WTP>() != null)
            data = new WTPSave(str);

		else if (str.GetComponent<Canal>() != null)
			data = new CanalSave(str);

		else if (str.GetComponent<House>() != null)
            data = new HouseSave(str.gameObject);

		else if (str.GetComponent<Farmhouse>() != null)
			data = new FarmhouseSave(str);

		else if (str.GetComponent<Workplace>() != null)
            data = new WorkplaceSave(str.gameObject);

        else if (str.GetComponent<Structure>() != null)
            data = new StructureSave(str.gameObject);

    }
コード例 #2
0
 public virtual void Load(StructureSave structureSave)
 {
     Location    = structureSave.location;
     ActiveTicks = structureSave.activeTicks;
     alliance    = Owner.alliance;
     extraData   = structureSave.extraData;
 }
コード例 #3
0
    public Action(string a, GameObject str)
    {
        Do = a;

        if (str.GetComponent <StorageBuilding>() != null)
        {
            data = (new StorageBuildingSave(str));
        }

        else if (str.GetComponent <Stable>() != null)
        {
            data = (new StableSave(str));
        }

        else if (str.GetComponent <Factory>() != null)
        {
            data = (new FactorySave(str));
        }

        else if (str.GetComponent <Generator>() != null)
        {
            data = (new GeneratorSave(str));
        }

        else if (str.GetComponent <Market>() != null)
        {
            data = (new MarketSave(str.gameObject));
        }

        else if (str.GetComponent <House>() != null)
        {
            data = (new HouseSave(str.gameObject));
        }

        else if (str.GetComponent <Workplace>() != null)
        {
            data = (new WorkplaceSave(str.gameObject));
        }

        else if (str.GetComponent <Structure>() != null)
        {
            data = (new StructureSave(str.gameObject));
        }
    }
コード例 #4
0
    public override void Load(ObjSave o)
    {
        base.Load(o);

        StructureSave s = (StructureSave)o;

        Sizex         = s.sizex;
        Sizey         = s.sizey;
        Days          = s.days;
        Weeks         = s.weeks;
        FireCount     = s.fireCount;
        CollapseCount = s.collapseCount;
        BurnCount     = s.burnCount;

        ActiveRandomWalker  = s.activeRandomWalker;
        ActiveCarryerWalker = s.activeCarryerWalker;
        ActiveImmigrant     = s.activeImmigrant;
        OnFire = s.OnFire;

        world.Map.RenameArea(name, X, Y, Sizex, Sizey);
    }
コード例 #5
0
ファイル: Structure.cs プロジェクト: chaojikugua/CapitalCity
    public override void Load(ObjSave o)
    {
        base.Load(o);

        StructureSave s = (StructureSave)o;

        Sizex        = s.sizex;
        Sizey        = s.sizey;
        Days         = s.days;
        Weeks        = s.weeks;
        Months       = s.months;
        FireRisk     = s.FireRisk;
        CollapseRisk = s.CollapseRisk;
        AmountStored = s.AmountStored;

        ActiveRandomWalker = s.activeRandomWalker;
        ActiveSmartWalker  = s.activeSmartWalker;

        world.Map.RenameArea(name, X, Y, Sizex, Sizey);

        collapseRiskMax = (int)(collapseRiskMax * Difficulty.GetModifier());
        fireRiskMax     = (int)(fireRiskMax * Difficulty.GetModifier());
    }
コード例 #6
0
ファイル: Radar.cs プロジェクト: JonRurka/WarWorldInfServer
 public override void Load(StructureSave structureSave)
 {
     base.Load(structureSave);
     Radius = ((RadarData)extraData).radius;
 }
コード例 #7
0
ファイル: Structure.cs プロジェクト: nug700/WarWorldInfServer
 public virtual void Load(StructureSave structureSave)
 {
     Location = structureSave.location;
     ActiveTicks = structureSave.activeTicks;
     alliance = Owner.alliance;
     extraData = structureSave.extraData;
 }
コード例 #8
0
ファイル: Radar.cs プロジェクト: nug700/WarWorldInfServer
 public override void Load(StructureSave structureSave)
 {
     base.Load(structureSave);
     Radius = ((RadarData)extraData).radius;
 }