public ConcurrentDictionary <int, Hangar> LoadPlayerHangars(int playerId) { var hangars = new ConcurrentDictionary <int, Hangar>(); var drones = LoadDrones(playerId); using (var mySqlClient = SqlDatabaseManager.GetClient()) { var queryTable = mySqlClient.ExecuteQueryTable("SELECT * FROM player_hangar WHERE PLAYER_ID=" + playerId); foreach (DataRow row in queryTable.Rows) { var id = Convert.ToInt32(row["ID"]); var active = Convert.ToBoolean(Convert.ToInt32(row["ACTIVE"])); var shipId = Convert.ToInt32(row["SHIP_ID"]); var shipDesign = Convert.ToInt32(row["SHIP_DESIGN"]); var hp = Convert.ToInt32(row["SHIP_HP"]); var nano = Convert.ToInt32(row["SHIP_NANO"]); var mapId = Convert.ToInt32(row["SHIP_MAP_ID"]); var shipX = Convert.ToInt32(row["SHIP_X"]); var shipY = Convert.ToInt32(row["SHIP_Y"]); var hangar = new Hangar(id, GameStorageManager.Instance.FindShip(shipId), drones, new Vector(shipX, shipY), GameStorageManager.Instance.FindMap(mapId), hp, nano, active); if (shipDesign != shipId) { hangar.ShipDesign = GameStorageManager.Instance.FindShip(shipDesign); } hangars.TryAdd(id, hangar); } } return(hangars); }
protected Pet(int id, string name, Hangar hangar, Factions factionId, Clan clan = null) : base(id, name, hangar, factionId, clan) { }