Пример #1
0
        public Dictionary <int, StationType> LoadStationTypes()
        {
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.Query(
                ref connection,
                "SELECT stationTypeID, hangarGraphicID, dockEntryX," +
                " dockEntryY, dockEntryZ, dockOrientationX, dockOrientationY," +
                " dockOrientationZ, operationID, officeSlots, reprocessingEfficiency, conquerable " +
                "FROM staStationTypes"
                );

            using (connection)
                using (reader)
                {
                    Dictionary <int, StationType> result = new Dictionary <int, StationType>();

                    while (reader.Read() == true)
                    {
                        StationType stationType = new StationType(
                            reader.GetInt32(0),
                            reader.GetInt32OrNull(1),
                            reader.GetDouble(2),
                            reader.GetDouble(3),
                            reader.GetDouble(4),
                            reader.GetDouble(5),
                            reader.GetDouble(6),
                            reader.GetDouble(7),
                            reader.GetInt32OrNull(8),
                            reader.GetInt32OrNull(9),
                            reader.GetDoubleOrNull(10),
                            reader.GetBoolean(11)
                            );

                        result[stationType.ID] = stationType;
                    }

                    return(result);
                }
        }