Example #1
0
        private void FillPlayersOfficers()
        {
            PlayerData pData = PlayerDataSql.GetTestPlayerData();

            listSaOfficers.Items.Clear();
            List <CrewOfficer> officers = CrewOfficer.OfficersForPlayer(pData.Id);

            if (officers.Count > 0)
            {
                foreach (CrewOfficer off in officers)
                {
                    listSaOfficers.Items.Add(off);
                }
            }
        }
Example #2
0
    public static SpaceshipRig RigForPlayer(int playerId)
    {
        SpaceshipRig  tRig = null;
        string        q    = SpaceshipRigQuery(0, playerId, "", false);
        SqlDataReader r    = DataConnection.GetReader(q);

        if (r.HasRows)
        {
            r.Read();
            tRig = new SpaceshipRig(r);
        }
        r.Close();
        if (tRig != null)
        {
            return(tRig);
        }


        List <Ship> ships = Ship.PlayerShips(playerId);

        if (ships.Count == 0)
        {
            return(null);
        }
        tRig = new SpaceshipRig();
        tRig.LoadShip(ships[0]);

        var moduleList = ShipModule.PlayerModules(playerId);

        tRig.LoadModules(moduleList);

        List <CrewOfficer> officers = CrewOfficer.OfficersForPlayer(playerId, true);

        officers.Add(new CrewOfficer(playerId));
        tRig.LoadOfficers(officers);
        return(tRig);
    }