public AttackGarrisoned(Actor self, AttackGarrisonedInfo info) : base(self, info) { Info = info; coords = Exts.Lazy(() => self.Trait <BodyOrientation>()); armaments = new List <Armament>(); muzzles = new List <AnimationWithOffset>(); paxFacing = new Dictionary <Actor, IFacing>(); paxPos = new Dictionary <Actor, IPositionable>(); paxRender = new Dictionary <Actor, RenderSprites>(); }
public AttackGarrisoned(Actor self, AttackGarrisonedInfo info) : base(self, info) { this.info = info; coords = Exts.Lazy(() => self.Trait <IBodyOrientation>()); armaments = new List <Armament>(); muzzles = new List <AnimationWithOffset>(); paxFacing = new Dictionary <Actor, IFacing>(); paxPos = new Dictionary <Actor, IPositionable>(); paxRender = new Dictionary <Actor, RenderSprites>(); getArmaments = () => armaments; if (info.PortOffsets.Length == 0) { throw new InvalidOperationException("PortOffsets must have at least one entry."); } if (info.PortYaws.Length != info.PortOffsets.Length) { throw new InvalidOperationException("PortYaws must define an angle for each port."); } if (info.PortCones.Length != info.PortOffsets.Length) { throw new InvalidOperationException("PortCones must define an angle for each port."); } var p = new List <FirePort>(); for (var i = 0; i < info.PortOffsets.Length; i++) { p.Add(new FirePort { Offset = info.PortOffsets[i], Yaw = info.PortYaws[i], Cone = info.PortCones[i], }); } Ports = p.ToArray(); }