void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { if (info.UseFuelReserve) { fueltank = newOwner.PlayerActor.Trait <Fueltank>(); } }
public NeedsFuel(Actor self, NeedsFuelInfo info) { this.self = self; Info = info; Fueltank = self.Trait <Fueltank>(); wasEmpty = Fueltank.IsEmpty; }
public RefuelsUnits(Actor self, RefuelsUnitsInfo info) { Info = info; var source = info.UseFuelReserve ? self.Owner.PlayerActor : self; Fueltank = source.Trait <Fueltank>(); }
public RefuelsUnitsNear(Actor self, RefuelsUnitsNearInfo info) { Info = info; this.self = self; fueltank = self.Trait <Fueltank>(); move = self.TraitOrDefault <IMove>(); ticks = info.TransferInterval; }
public Refuelable(Actor self, RefuelableInfo info) { this.self = self; Info = info; excludeSelf = new[] { self }; Fueltank = self.Trait <Fueltank>(); Move = self.Trait <IMove>(); }
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { if (Info.UseFuelReserve) { fueltank = newOwner.PlayerActor.Trait <Fueltank>(); } resources = newOwner.PlayerActor.TraitOrDefault <PlayerResources>(); }
public FuelGenerator(Actor self, FuelGeneratorInfo info) { Info = info; var source = info.UseFuelReserve ? self.Owner.PlayerActor : self; fueltank = source.Trait <Fueltank>(); resources = self.Owner.PlayerActor.TraitOrDefault <PlayerResources>(); ticks = info.Interval; }
public void RefuelUnit(Actor self, Actor unit) { if (CurrentUnit != null) { return; } var refuelable = unit.TraitOrDefault <Refuelable>(); if (refuelable == null || !refuelable.CanRefuelAt(self, this)) { return; } otherFueltank = refuelable.Fueltank; CurrentUnit = unit; cachedPosition = CurrentUnit.CenterPosition; ticks = Info.TransferInterval; }
void INotifyCreated.Created(Actor self) { var source = info.UseFuelReserve ? self.Owner.PlayerActor : self; fueltank = source.Trait <Fueltank>(); }
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { fuelReserve.RemoveCapacity(info.Capacity); fuelReserve = newOwner.PlayerActor.Trait <Fueltank>(); fuelReserve.AddCapacity(info.Capacity); }
public FuelStorage(Actor self, FuelStorageInfo info) { this.info = info; fuelReserve = self.Owner.PlayerActor.Trait <Fueltank>(); }