Ejemplo n.º 1
0
 public View GetView(IHelm me)
 {
     lock (m_locker)
     {
         bool blind = me.IsDead() || !me.InSpace();
         return(new View
         {
             Time = Time,
             Helm = HelmDefinition.Store(me),
             Ships = blind ? new ShipDefinition[0] : GetVisibleShips(me).Select(ShipDefinition.Store).ToArray(),
             Missiles = blind ? new MissileDefinition[0] : GetVisibleMissiles(me).Select(MissileDefinition.Store).ToArray(),
             Stars = GetStars().ToArray(),
         });
     }
 }
Ejemplo n.º 2
0
 public View GetView(IHelm me)
 {
     lock (m_locker)
     {
         bool blind = me.State == ShipState.Annihilated || me.State == ShipState.Junk || me.State == ShipState.Hyperspace;
         return(new View
         {
             Time = Time,
             Helm = HelmDefinition.Store(me),
             Ships = blind ? new ShipDefinition[0] : GetVisibleShips(me).Select(ShipDefinition.Store).ToArray(),
             Missiles = blind ? new MissileDefinition[0] : GetVisibleMissiles(me).Select(MissileDefinition.Store).ToArray(),
             Stars = GetStars().ToArray(),
         });
     }
 }
Ejemplo n.º 3
0
 public static HelmDefinition Store(IHelm helm)
 {
     return(new HelmDefinition
     {
         AccelerateTo = helm.AccelerateTo,
         HeadingTo = helm.HeadingTo,
         RollTo = helm.RollTo,
         Acceleration = helm.Ship.Acceleration,
         Heading = helm.Ship.Heading,
         Roll = helm.Ship.Roll,
         ShipName = helm.Ship.Name,
         ClassName = helm.Ship.ClassName,
         Nation = helm.Ship.Nation,
         Position = helm.Ship.S,
         Speed = helm.Ship.V,
         MissileName = helm.Ship.MissileName,
         MissileNumber = helm.Ship.Missiles,
     });
 }
Ejemplo n.º 4
0
        private void Login()
        {
            client = new SF.ClientLibrary.SpaceClient();
            var credentials = LogonDialog.Execute(client.GetShipNames());

            if (credentials == null)
            {
                Close();
            }
            else
            {
                client.Login(credentials.Nation, credentials.ShipName);
                helm = client.GetHelm();
                Text = helm.Name;
                spaceGridControl.OwnShip    = helm;
                spaceGridControl.WorldScale = Catalog.Instance.DefaultScale;
                scaleControl.Value          = Catalog.Instance.DefaultScale;;
                tableLayoutPanel.Visible    = true;
                timerUpdate.Enabled         = true;
            }
        }
Ejemplo n.º 5
0
 public static HelmDefinition Store(IHelm helm)
 {
     return(new HelmDefinition
     {
         Id = helm.Id,
         ThrustTo = helm.ThrustTo,
         HeadingTo = helm.HeadingTo,
         RollTo = helm.RollTo,
         Thrust = helm.Thrust,
         Heading = helm.Heading,
         Roll = helm.Roll,
         Name = helm.Name,
         ClassName = helm.ClassName,
         Nation = helm.Nation,
         Position = helm.Position,
         Speed = helm.Speed,
         MissileName = helm.MissileName,
         Missiles = helm.Missiles,
         Radius = helm.Radius,
         Weight = helm.Weight,
         State = helm.State,
     });
 }
Ejemplo n.º 6
0
        public TokunoGalleon()
            : base(0x30)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x91CC, new Point3D(0, -9, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x91AA, new Point3D(-2, -3, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x91A6, new Point3D(2, -3, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x9187, new Point3D(-2, 2, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x9183, new Point3D(2, 2, 0));
            m_Helm = new SingleHelm(this, 0x9316, new Point3D(0, 7, 1));
            m_Hold = new GalleonHold(this, 0x9177, new Point3D(0, 4, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x9170, new Point3D(0, 1, 0)),
                    new Tuple<int, Point3D>(0x9178, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x9171, new Point3D(-1, 1, 0)),
                    new Tuple<int, Point3D>(0x9176, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x916F, new Point3D(1, 1, 0)),                    
                }, 16000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -2, 6), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -2, 6), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 3, 6), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 3, 6), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, -2, 6) );
			Name = "a Tokuno Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;			
			
        }
Ejemplo n.º 7
0
        public BritainGalleon()
            : base(0x40)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x5C06, new Point3D(0, -9, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x5C19, new Point3D(-3, -5, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x5C18, new Point3D(3, -5, 0));
            m_CannonMidSupSx = new SingleCannonPlace(this, 0x5C1A, new Point3D(-3, -1, 0));
            m_CannonMidSupDx = new SingleCannonPlace(this, 0x5C1C, new Point3D(3, -1, 0));
            m_CannonMidInfSx = new SingleCannonPlace(this, 0x5C21, new Point3D(-3, 3, 0));
            m_CannonMidInfDx = new SingleCannonPlace(this, 0x5C1F, new Point3D(3, 3, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x5C25, new Point3D(-3, 7, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x5C23, new Point3D(3, 7, 0));
            m_Helm = new SingleHelm(this, 0x5C0C, new Point3D(0, 3, 1));
            m_Hold = new GalleonHold(this, 0x5C2A, new Point3D(0, 9, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x5C2C, new Point3D(-1, -1, 0)),
                    new Tuple<int, Point3D>(0x5C2F, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x5C32, new Point3D(-1, 1, 0)),

                    new Tuple<int, Point3D>(0x5C2D, new Point3D(0, 0, 0)),
                    new Tuple<int, Point3D>(0x5C30, new Point3D(0, 1, 0)),   
                 
                    new Tuple<int, Point3D>(0x5C2B, new Point3D(1, -1, 0)),
                    new Tuple<int, Point3D>(0x5C2E, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x5C31, new Point3D(1, 1, 0)),
                }, 28000);

            m_MainMast = new MainMast(this, 0x5CE3, new Point3D(0, -3, 0));
            m_Hull = new BritainHull(this, 0x58A5);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, -4, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, -4, 16), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 0, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 0, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 4, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 4, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-3, 8, 16), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(3, 8, 16), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, 7, 12) );
			Name = "a Britain Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;				
			
        }
Ejemplo n.º 8
0
 public IEnumerable <IMissile> GetVisibleMissiles(IHelm me)
 {
     return(this.m_missiles);
 }
Ejemplo n.º 9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_CannonCenter = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupSx = reader.ReadItem() as MultiCannonPlace;
            m_CannonSupDx = reader.ReadItem() as MultiCannonPlace;
            m_CannonMidSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfSx = reader.ReadItem() as MultiCannonPlace;
            m_CannonInfDx = reader.ReadItem() as MultiCannonPlace;
            m_Helm = reader.ReadItem() as MultiHelm;
            m_Hold = reader.ReadItem() as GalleonHold;
        }
Ejemplo n.º 10
0
        public OrcGalleon()
            : base(0x18)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x7924, new Point3D(0, -6, 0));
            m_CannonSupSx = new MultiCannonPlace(this, 0x793D, new Point3D(-2, -2, 0), 0x7944, 0x7936);
            m_CannonSupDx = new MultiCannonPlace(this, 0x7941, new Point3D(2, -2, 0), 0x7948, 0x793A);
            m_CannonMidSx = new SingleCannonPlace(this, 0x7959, new Point3D(-2, 2, 0));
            m_CannonMidDx = new SingleCannonPlace(this, 0x795D, new Point3D(2, 2, 0));
            m_CannonInfSx = new MultiCannonPlace(this, 0x796E, new Point3D(-2, 5, 0), 0x7975);
            m_CannonInfDx = new MultiCannonPlace(this, 0x7972, new Point3D(2, 5, 0), 0x7979);
            m_Helm = new MultiHelm(this, 0x79A5, new Point3D(0, 7, 1), 0x79A4, 0x79A6);
            m_Hold = new GalleonHold(this, 0x798D, new Point3D(0, 9, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x7994, new Point3D(0, 1, 0)),
                    new Tuple<int, Point3D>(0x798B, new Point3D(-1, 0, 0)),
                    new Tuple<int, Point3D>(0x7992, new Point3D(-1, 1, 0)),
                    new Tuple<int, Point3D>(0x7990, new Point3D(1, 0, 0)),
                    new Tuple<int, Point3D>(0x7997, new Point3D(1, 1, 0)),                    
                }, 14000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -1, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -1, 14), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 3, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 3, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 7, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 7, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, 2, 10) );
			Name = "an Orc Galleon";

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;	
        }
Ejemplo n.º 11
0
        public GargoyleGalleon()
            : base(0x24)
        {
            m_CannonCenter = new SingleCannonPlace(this, 0x8516, new Point3D(0, -8, 0));
            m_CannonSupSx = new SingleCannonPlace(this, 0x84FD, new Point3D(-2, -5, 0));
            m_CannonSupDx = new SingleCannonPlace(this, 0x84FF, new Point3D(2, -5, 0));
            m_CannonMidSx = new SingleCannonPlace(this, 0x8489, new Point3D(-2, -2, 0));
            m_CannonMidDx = new SingleCannonPlace(this, 0x848E, new Point3D(2, -2, 0));
            m_CannonInfSx = new SingleCannonPlace(this, 0x84AA, new Point3D(-2, 1, 0));
            m_CannonInfDx = new SingleCannonPlace(this, 0x84AC, new Point3D(2, 1, 0));
            m_Helm = new SingleHelm(this, 0x85A0, new Point3D(0, 2, 0));
            m_Hold = new GalleonHold(this, 0x84CA, new Point3D(0, 5, 0),
                new List<Tuple<int, Point3D>>() 
                {
                    new Tuple<int, Point3D>(0x84CC, new Point3D(-2, 0, 0)), // stiva lato sx 1/4
                    new Tuple<int, Point3D>(0x84D3, new Point3D(-2, 1, 0)), // stiva lato sx 2/4
                    new Tuple<int, Point3D>(0x84DA, new Point3D(-2, 2, 0)), // stiva lato sx 3/4
                    new Tuple<int, Point3D>(0x84E1, new Point3D(-2, 3, 0)), // stiva lato sx 4/4

                    new Tuple<int, Point3D>(0x84CB, new Point3D(-1, 0, 0)), // stiva sup sx       
                    new Tuple<int, Point3D>(0x84D2, new Point3D(-1, 1, 0)), // stiva Centro sx 1/2
                    new Tuple<int, Point3D>(0x84D9, new Point3D(-1, 2, 0)), // stiva Centro sx 2/2
                    new Tuple<int, Point3D>(0x84E0, new Point3D(-1, 3, 0)), // stiva inf sx
   
                    //new Tuple<int, Point3D>(0x84CA, new Point3D(0, 0, 0)),  // stiva sup ( container )
                    new Tuple<int, Point3D>(0x84D1, new Point3D(0, 1, 0)),  // stiva Centro 1/2
                    new Tuple<int, Point3D>(0x84D8, new Point3D(0, 2, 0)),  // stiva Centro 2/2 
                    new Tuple<int, Point3D>(0x84DF, new Point3D(0, 3, 0)),  // stiva inf

                    new Tuple<int, Point3D>(0x84D0, new Point3D(1, 0, 0)), // stiva sup dx 
                    new Tuple<int, Point3D>(0x84D7, new Point3D(1, 1, 0)), // stiva Centro dx 1/2
                    new Tuple<int, Point3D>(0x84DE, new Point3D(1, 2, 0)), // stiva Centro dx 2/2
                    new Tuple<int, Point3D>(0x84E5, new Point3D(1, 3, 0)), // stiva inf dx

                    new Tuple<int, Point3D>(0x84CE, new Point3D(2, 0, 0)), // stiva lato dx 1/4
                    new Tuple<int, Point3D>(0x84D5, new Point3D(2, 1, 0)), // stiva lato dx 2/4
                    new Tuple<int, Point3D>(0x84DC, new Point3D(2, 2, 0)), // stiva lato dx 3/4
                    new Tuple<int, Point3D>(0x84E3, new Point3D(2, 3, 0)), // stiva lato dx 4/4
                }, 12000);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -4, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -4, 14), BoatRopeSide.Port, 0); 
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, -1, 14), BoatRopeSide.Starboard, 0);
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, -1, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
            m_SRope = new BoatRope2(this, 0x14F8, new Point3D(-2, 2, 14), BoatRopeSide.Starboard, 0); 
			Ropes.Add(m_SRope);
            m_PRope = new BoatRope2(this, 0x14F8, new Point3D(2, 2, 14), BoatRopeSide.Port, 0);
			Ropes.Add(m_PRope);
			m_TillerMan = new TillerManHS(this, 0, new Point3D(0, -4, 12) );
			Name = "a Gargoyle Galleon";
			
            // make them siegable by default
            // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone)

            // undo the temporary hue indicator that is set when the xmlsiege attachment is added
            this.Hue = 0;			
			
        }
Ejemplo n.º 12
0
 private IEnumerable <IShip> GetVisibleShips(IHelm me)
 {
     return(m_helms.Values.Where(i => i != me));
 }
Ejemplo n.º 13
0
 public IEnumerable <IShip> GetVisibleShips(IHelm me)
 {
     return(this.m_helms.Where(i => i.Value != me).Select(i => i.Value.Ship));
 }
Ejemplo n.º 14
0
 public bool Login(string nation, string ship)
 {
     m_helm = Universe.GetHelm(nation, ship);
     return(m_helm != null);
 }
Ejemplo n.º 15
0
 public void Connect(string password)
 {
     this.m_helm = null;
 }
Ejemplo n.º 16
0
 public void Logout()
 {
     this.m_helm = null;
 }
Ejemplo n.º 17
0
 public bool Login(string nation, string ship)
 {
     this.m_helm = Instance.GetHelm(nation, ship);
     return(this.m_helm != null);
 }
Ejemplo n.º 18
0
 public void Logout()
 {
     m_helm = null;
 }
Ejemplo n.º 19
0
 private IEnumerable <IMissile> GetVisibleMissiles(IHelm me)
 {
     return(m_missiles);
 }
Ejemplo n.º 20
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_CannonCenter = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonSupDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidSupSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidSupDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidInfSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonMidInfDx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfSx = reader.ReadItem() as SingleCannonPlace;
            m_CannonInfDx = reader.ReadItem() as SingleCannonPlace;
            m_Helm = reader.ReadItem() as SingleHelm;
            m_Hold = reader.ReadItem() as GalleonHold;
            m_MainMast = reader.ReadItem() as MainMast;
            m_Hull = reader.ReadItem() as BritainHull;
        }