public BodyOrientation(Actor self, BodyOrientationInfo info) { this.info = info; if (info.QuantizedFacings > 0) { QuantizedFacings = info.QuantizedFacings; } }
public BodyOrientation(Actor self, BodyOrientationInfo info) { this.info = info; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) return info.QuantizedFacings; var qboi = self.Info.Traits.GetOrDefault<IQuantizeBodyOrientationInfo>(); if (qboi == null) throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); return qboi.QuantizedBodyFacings(self.World.Map.SequenceProvider, self.Info); }); }
public BodyOrientation(ActorInitializer init, BodyOrientationInfo info) { this.info = info; var self = init.Self; var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) return info.QuantizedFacings; var qboi = self.Info.Traits.GetOrDefault<IQuantizeBodyOrientationInfo>(); if (qboi == null) throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); return qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, race); }); }
public BodyOrientation(Actor self, BodyOrientationInfo info) { this.info = info; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) { return(info.QuantizedFacings); } var qboi = self.Info.Traits.GetOrDefault <IQuantizeBodyOrientationInfo>(); if (qboi == null) { throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); } return(qboi.QuantizedBodyFacings(self.World.Map.SequenceProvider, self.Info)); }); }
public BodyOrientation(ActorInitializer init, BodyOrientationInfo info) { this.info = info; var self = init.Self; var race = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) { return(info.QuantizedFacings); } var qboi = self.Info.Traits.GetOrDefault <IQuantizeBodyOrientationInfo>(); if (qboi == null) { throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); } return(qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, race)); }); }
public BodyOrientation(Actor self, BodyOrientationInfo info) { this.info = info; if (info.QuantizedFacings > 0) QuantizedFacings = info.QuantizedFacings; }