Ejemplo n.º 1
0
 public BodyOrientation(Actor self, BodyOrientationInfo info)
 {
     this.info = info;
     if (info.QuantizedFacings > 0)
     {
         QuantizedFacings = info.QuantizedFacings;
     }
 }
Ejemplo n.º 2
0
        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);
            });
        }
Ejemplo n.º 3
0
        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);
            });
        }
Ejemplo n.º 4
0
        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));
            });
        }
Ejemplo n.º 5
0
        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));
            });
        }
Ejemplo n.º 6
0
 public BodyOrientation(Actor self, BodyOrientationInfo info)
 {
     this.info = info;
     if (info.QuantizedFacings > 0)
         QuantizedFacings = info.QuantizedFacings;
 }