Example #1
0
 public Station(StationType stationType, StationOperations operations, int security,
                double dockingCostPerVolume, double maxShipVolumeDockable, int officeRentalCost, int constellationId,
                int regionId, double reprocessingEfficiency, double reprocessingStationsTake, int reprocessingHangarFlag,
                ItemEntity from) : base(from)
 {
     this.mStationType              = stationType;
     this.mOperations               = operations;
     this.mSecurity                 = security;
     this.mDockingCostPerVolume     = dockingCostPerVolume;
     this.mMaxShipVolumeDockable    = maxShipVolumeDockable;
     this.mOfficeRentalCost         = officeRentalCost;
     this.mConstellationID          = constellationId;
     this.mRegionID                 = regionId;
     this.mReprocessingEfficiency   = reprocessingEfficiency;
     this.mReprocessingStationsTake = reprocessingStationsTake;
     this.mReprocessingHangarFlag   = reprocessingHangarFlag;
     this.mGuests = new Dictionary <int, Character>();
 }
Example #2
0
        public Dictionary <int, StationOperations> LoadOperations()
        {
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.Query(ref connection, "SELECT operationID, operationName, description FROM staOperations");

            using (connection)
                using (reader)
                {
                    Dictionary <int, StationOperations> operations = new Dictionary <int, StationOperations>();

                    while (reader.Read() == true)
                    {
                        List <int>      services           = new List <int>();
                        MySqlConnection connectionServices = null;
                        MySqlDataReader readerServices     = Database.PrepareQuery(ref connectionServices,
                                                                                   "SELECT serviceID FROM staOperationServices WHERE operationID = @operationID",
                                                                                   new Dictionary <string, object>()
                        {
                            { "@operationID", reader.GetUInt32(0) }
                        }
                                                                                   );

                        using (connectionServices)
                            using (readerServices)
                            {
                                while (readerServices.Read() == true)
                                {
                                    services.Add(readerServices.GetInt32(0));
                                }
                            }

                        StationOperations operation = new StationOperations(
                            reader.GetInt32(0),
                            reader.GetString(1),
                            reader.GetString(2),
                            services
                            );

                        operations[operation.OperationID] = operation;
                    }

                    return(operations);
                }
        }