コード例 #1
0
        protected override void DoOnPossessionBroken(IUnit unit, ICivilization oldOwner)
        {
            foreach (var resource in unit.RequiredResources)
            {
                ResourceLockingCanon.UnlockCopyOfResourceForCiv(resource, oldOwner);
            }

            CivSignals.CivLostUnit.OnNext(new Tuple <ICivilization, IUnit>(oldOwner, unit));
            UnitSignals.GainedNewOwner.OnNext(new Tuple <IUnit, ICivilization>(unit, null));
        }
コード例 #2
0
        protected override void DoOnPossessionBroken(IBuilding building, ICity oldOwner)
        {
            if (oldOwner == null)
            {
                return;
            }

            var cityOwner = CityPossessionCanon.GetOwnerOfPossession(oldOwner);

            foreach (var resource in building.Template.ResourcesConsumed)
            {
                ResourceLockingCanon.UnlockCopyOfResourceForCiv(resource, cityOwner);
            }

            CitySignals.LostBuilding.OnNext(new Tuple <ICity, IBuilding>(oldOwner, building));
        }