public Station(string name, int order, StationType type) { Name = name; Order = order; Type = type; Status = StationStatus.Open; }
public StationInfo() { type = StationType.Unknown; state = StationState.Normal; tradingStock = new List<TradingGoods>(); }
public async override Task TestFindByIdAsync() { StationType t = stationTypes[0]; StationType s = await stationTypeDao.FindByIdAsync(t.StationTypeId); Assert.AreEqual(t, s); }
private bool ClusterContainsStation(StationType stationType, IclusterIGCWrapper currentCluster) { switch (stationType) { // If the tech rock is gone, then we'll consider this cluster to have this station in it case StationType.Expansion: case StationType.Supremacy: case StationType.Tactical: return(GetClusterTechRock(currentCluster) == null); case StationType.Garrison: return(currentCluster.GetStations().Exists(p => p.GetSide().GetObjectID() == ClientConnection.GetSide().GetObjectID() && (p.GetName().Contains("Garrison") == true || p.GetName().Contains("Starbase") == true))); case StationType.ShipYard: return(currentCluster.GetStations().Exists(p => p.GetSide().GetObjectID() == ClientConnection.GetSide().GetObjectID() && (p.GetName().Contains("Ship") == true || p.GetName().Contains("Dry") == true))); case StationType.Outpost: return(currentCluster.GetStations().Exists(p => p.GetSide().GetObjectID() == ClientConnection.GetSide().GetObjectID() && (p.GetName().Contains("Outpost") == true || p.GetName().Contains("Garrison") == true || p.GetName().Contains("Starbase") == true))); case StationType.Refinery: return(currentCluster.GetStations().Exists(p => p.GetSide().GetObjectID() == ClientConnection.GetSide().GetObjectID() && (p.GetName().Contains("Refinery") == true || p.GetName().Contains("Special") == true || p.GetName().Contains("Outpost") == true || p.GetName().Contains("Garrison") == true || p.GetName().Contains("Starbase") == true))); case StationType.Teleport: return(currentCluster.GetStations().Exists(p => p.GetSide().GetObjectID() == ClientConnection.GetSide().GetObjectID() && p.GetName().Contains("Teleport") == true)); default: throw new NotSupportedException(stationType.ToString()); } }
public static async Task ClassInitializeAsync(TestContext context) { StationType t1 = new StationType { StationTypeId = 2, Name = "MyStationType1" }; StationType t2 = new StationType { StationTypeId = 3, Name = "MyStationType2" }; StationType t3 = new StationType { StationTypeId = 4, Name = "MyStationType3" }; stationTypes.Add(t1); stationTypes.Add(t2); stationTypes.Add(t3); foreach (StationType s in stationTypes) { await stationTypeDao.InsertAsync(s); } }
public async Task <bool> DeleteStationTypeAsync(StationType stationType) { return(await _template.ExecuteAsync( "DELETE FROM station_type WHERE id = @id", new[] { new QueryParameter("@id", stationType.Id) }) == 1); }
public StationControllerPersistance(bool constructed, float constructionProgress, MapObjectPersitance mapObjectPersitance, Station station, StationType stationType, bool initialized) { this.constructed = constructed; this.constructionProgress = constructionProgress; this.mapObjectPersitance = mapObjectPersitance; this.station = station; this.stationType = stationType; this.initialized = initialized; }
public async override Task TestDeleteAsync() { StationType t = stationTypes[0]; await stationTypeDao.DeleteAsync(t.StationTypeId); StationType s = await stationTypeDao.FindByIdAsync(t.StationTypeId); Assert.IsNull(s); }
public StationInfo(string name, long id, string systemName, long systemId, string type, float distance) { Name = name; Id = id; SystemName = systemName; SystemId = systemId; Type = ParseStationType(type); Distance = (int)distance; }
//**CONFIRMED public static Packet GetPacket(StationType station, bool isSelected) { SetStationSubPacket sstp = new SetStationSubPacket(station, isSelected); ShipActionPacket sap = new ShipActionPacket(sstp); return new Packet(sap); }
public async Task FindById() { IStationTypeDao stationTypeDao = new AdoStationTypeDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)); StationType stationType = await stationTypeDao.FindByIdAsync(1); Assert.IsTrue(stationType != null && stationType.Id == 1); }
protected override void RefreshMissionDetails(StationType stationType = StationType.INVALID_TYPE, int stationLevel = 1) { StationInfo stationInfo = this.App.GameDatabase.GetStationInfo(this.SelectedStation); if (stationInfo == null) { return; } base.RefreshMissionDetails(stationInfo.DesignInfo.StationType, stationInfo.DesignInfo.StationLevel + 1); }
public async Task <bool> UpdateAllAsync(StationType stationType) { return(await _template.ExecuteAsync( "UPDATE station_type SET manufacturer = @manufacturer, model = @model WHERE id = @id", new[] { new QueryParameter("@manufacturer", stationType.Manufacturer), new QueryParameter("@model", stationType.Model), new QueryParameter("@id", stationType.Id) }) == 1); }
public async Task <bool> AddStationTypeAsync(StationType stationType) { return(await _template.ExecuteAsync( "INSERT INTO station_type (manufacturer, model) " + "VALUES (@manufacturer, @model)", new[] { new QueryParameter("@manufacturer", stationType.Manufacturer), new QueryParameter("@model", stationType.Model) }) == 1); }
/// <summary> /// </summary> /// <param name="PlaylistTypes"> </param> public Channel(StationType PlaylistTypes) // : base(PlaylistTypes) { InitializeComponent(); PlaylistType = PlaylistTypes; LoadImages(); // events Settings.Default.SettingChanging += ChannelSection_SettingChanging; }
public IwSK2() { InitializeComponent(); stationType = StationType.Master; transactionType = TransactionType.Broadcast; cbCommandMaster.DataSource = commands.Take(1).ToList(); // rozkaz 2 dostepny tylko w adresowanej cbCommandMaster.SelectedIndex = -1; cbPorts.DataSource = SerialPort.GetPortNames(); cbPorts.SelectedIndex = -1; }
public async Task FindByManufacturer() { IStationTypeDao stationTypeDao = new AdoStationTypeDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)); IEnumerable <StationType> stationTypes = await stationTypeDao.FindByManufacturerAsync("SKEY"); StationType stationType = stationTypes.FirstOrDefault(); Assert.IsTrue(stationType != null && stationType.Id == 1); }
private void loadStationsFromSettings() { if (Properties.Settings.Default.stationNames != null && Properties.Settings.Default.stationNames.Count > 0) { Station[] stations = new Station[Properties.Settings.Default.stationNames.Count]; for (int x = 0; x < Properties.Settings.Default.stationNames.Count; x++) { StationType type = StationType.Standard; string name = Properties.Settings.Default.stationNames[x]; string stationText; if (Properties.Settings.Default.stationTypes != null && Properties.Settings.Default.stationTypes.Count > x) { stationText = Properties.Settings.Default.stationTypes[x].Trim().ToLower(); } else { stationText = ""; } if (stationText == "stream") { type = StationType.Stream; } else if (stationText == "recording") { type = StationType.Recording; } else if (stationText == "premium") { type = StationType.Premium; } else if (stationText == "backup") { type = StationType.Backup; } else if (stationText == "noassign") { type = StationType.NoAssign; } Station station = new Station(name, x, type); stations[x] = station; } reinitializeStations(stations); } else { Station[] stations = new Station[0]; reinitializeStations(stations); } }
private void New() { try { _selectedStationType = new StationType(); BindingDataToControls(); } catch (Exception ex) { ViewController.ShowError(ex.Message); } }
private void SelectionChangedCommandExcute() { if (StationType.Equals("110kV_A2-7")) { //è®¾ç½®æ ‡é«˜åˆ—è¡¨çš„å€¼ï¼ˆå…ˆæ¸…ç©ºï¼‰ MockLevels.Clear(); MockLevel L1 = new MockLevel() { Name = "-3.300米层", Elevation = -3300 / 304.8, IsStructural = true }; MockLevel L2 = new MockLevel() { Name = "-3.200米层", Elevation = -3200 / 304.8, IsStructural = false }; MockLevel L4 = new MockLevel() { Name = "-1.050米层", Elevation = -1050 / 304.8, IsStructural = false }; MockLevel L5 = new MockLevel() { Name = "-0.050米层", Elevation = -50 / 304.8, IsStructural = true }; MockLevel L6 = new MockLevel() { Name = "0.000米层", Elevation = 0, IsStructural = false }; MockLevel L7 = new MockLevel() { Name = "4.750米层", Elevation = 4750 / 304.8, IsStructural = true }; MockLevel L8 = new MockLevel() { Name = "4.800米层", Elevation = 4800 / 304.8, IsStructural = false }; MockLevel L9 = new MockLevel() { Name = "9.600米层", Elevation = 9600 / 304.8, IsStructural = true }; MockLevel L10 = new MockLevel() { Name = "10.600米层", Elevation = 10600 / 304.8, IsStructural = true }; MockLevels.Add(L1); MockLevels.Add(L2); MockLevels.Add(L4); MockLevels.Add(L5); MockLevels.Add(L6); MockLevels.Add(L7); MockLevels.Add(L8); MockLevels.Add(L9); MockLevels.Add(L10); } }
public void CreateStation(SpaceModel stationLocation, StationType stationType, ModelLink link) { //int reset = 999; GenerateStationResources(StationType.Reset); GenerateStationResources(stationType); // IF THE LOADING TIME TAKES TOO LONG, THIS NEEDS TO BE DONE ONLY WHEN A STATION IS DOCKED AT Station newStation = new Station(stationLocation, stationType, metalAvailable, metalPrice, organicAvailable, organicPrice, fuelAvailable, fuelPrice, gasAvailable, gasPrice, waterAvailable, waterPrice, this); link.CreateStationView(newStation); allStations.Add(stationLocation, newStation); }
public void DockComplete(StationBase dockedStation, StationType type) { GameManager.Inst.SaveGameManager.CreateAnchorSave(dockedStation, type); if (type == StationType.Station) { GameManager.Inst.UIManager.FadePanel.FadeOut(0.4f); } else if (type == StationType.JumpGate) { GameManager.Inst.UIManager.FadePanel.WhiteFadeOut(0.75f); } }
/// <summary> Constructeur par type </summary> /// <param name="type">le type de la station</param> /// <param name="starSystem">Le systeme solair qui contient cette station</param> /// <param name="position">La position de la station dans son syteme, en AU</param> /// <param name="iID">Un identifiant pour cette station</param> public Station(StationType type, StarSystem starSystem, OSTTools.Vector3 position, int iID) { Type = type; Position = position; _gates = new List <Portal>(); Name = "StationName"; System = starSystem; ID = iID; Hangar h = new Hangar(this, starSystem.Universe.GetCorporation(-1)); _hangars.Add(-1, h); }
private IasteroidIGCWrapper GetStationBuildRock(StationType stationType, IclusterIGCWrapper cluster) { switch (stationType) { case StationType.Expansion: case StationType.Supremacy: case StationType.Tactical: return(GetClusterTechRock(cluster)); default: return(GetAsteroidClosestToClusterCenter(cluster)); } }
public static StationType ToType(this StationTypeFlags value) { for (int index = 0; index < 8; ++index) { StationType stationType = (StationType)index; StationTypeFlags flags = stationType.ToFlags(); if ((flags & value) == flags) { return(stationType); } } return(StationType.INVALID_TYPE); }
private void rbMaster_CheckedChanged(object sender, EventArgs e) { gbMaster.Enabled = !gbMaster.Enabled; gbSlave.Enabled = !gbSlave.Enabled; if (stationType == StationType.Slave) { stationType = StationType.Master; } else { stationType = StationType.Slave; } }
public override void Initialize() { this.App.UI.UnlockUI(); this.App.UI.AddItem("filterDropdown", "", 0, App.Localize("@UI_STATION_MANAGER_ALL_STATIONS")); this.App.UI.AddItem("filterDropdown", "", 1, App.Localize("@UI_STATION_MANAGER_NAVAL")); this.App.UI.AddItem("filterDropdown", "", 2, App.Localize("@UI_STATION_MANAGER_SCIENCE")); this.App.UI.AddItem("filterDropdown", "", 3, App.Localize("@UI_STATION_MANAGER_CIVILIAN")); this.App.UI.AddItem("filterDropdown", "", 4, App.Localize("@UI_STATION_MANAGER_DIPLOMATIC")); this.App.UI.AddItem("filterDropdown", "", 5, App.Localize("@UI_STATION_MANAGER_GATE")); this.App.UI.AddItem("filterDropdown", "", 6, App.Localize("@UI_STATION_MANAGER_MINING")); this.App.UI.SetSelection("filterDropdown", 0); this._currentFilterMode = StationType.INVALID_TYPE; }
private static string GetStationIcon(StationType type, bool zuul) { string str = StationUI.StationIconMap[type]; if (zuul && type == StationType.CIVILIAN) { str = "stationicon_slave"; } else if (zuul && type == StationType.DIPLOMATIC) { str = "stationicon_tribute"; } return(str); }
/** * Make the given tile a station tile. * @param t the tile to make a station tile * @param o the owner of the station * @param sid the station to which this tile belongs * @param st the type this station tile * @param section the StationGfx to be used for this tile * @param wc The water class of the station */ public static void MakeStation(this TileIndex t, Owner o, StationID sid, StationType st, byte section, WaterClass wc = WaterClass.WATER_CLASS_INVALID) { TileMap.SetTileType(t, TileType.MP_STATION); TileMap.SetTileOwner(t, o); WaterMap.SetWaterClass(t, wc); Map._m[t].m2 = sid; Map._m[t].m3 = 0; Map._m[t].m4 = 0; Map._m[t].m5 = section; Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 2, 1, 0); Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 3, 3, st); Map._me[t].m7 = 0; }
private void initializeStations(string filePath) { //Get station names from file var lines = File.ReadAllLines(filePath); //Only allow distinct station names and dont allow any station called "Any" as that is a reserved name var uniqueStations = lines.Select(line => { var commaSeparated = line.Split(','); var name = commaSeparated.Length == 0 ? string.Empty : commaSeparated[0]; StationType type = StationType.Standard; if (commaSeparated.Length > 1) { var stationText = commaSeparated[1].Trim().ToLower(); if (stationText == "stream") { type = StationType.Stream; } else if (stationText == "recording") { type = StationType.Recording; } else if (stationText == "premium") { type = StationType.Premium; } else if (stationText == "backup") { type = StationType.Backup; } else if (stationText == "noassign") { type = StationType.NoAssign; } } return(new { Name = name, Type = type }); }).GroupBy(a => a.Name).Select(g => g.First()).Where(a => { var trimmedName = a.Name.Trim().ToLower(); return(trimmedName != "any" && !string.IsNullOrWhiteSpace(trimmedName)); }).Select((a, i) => new Station(a.Name, i, a.Type)).ToArray(); //Initialize stations reinitializeStations(uniqueStations); }
protected override void OnEnter() { base.OnEnter(); this.App.UI.SetEnabled(this.App.UI.Path(this.ID, "gamePlaceStationMissionButton"), false); this.SelectedPlanet = this.GetMissionTargetPlanets().FirstOrDefault <int>(); this.SetSelectedPlanet(this.SelectedPlanet, string.Empty); this.SyncAvailableStationTypes(); this.SelectADefaultStation(); if (this._superspecialsecretmission == null || this._superspecialsecretmission._forcedStationType == StationType.INVALID_TYPE) { return; } this.SelectedStationType = this._superspecialsecretmission._forcedStationType; }
/// <summary>Creates a train-specific station</summary> /// <param name="s">The base station</param> /// <param name="stopPosition">The stop position applicable to our train</param> public Station(Station s, double stopPosition) { Name = s.Name; ArrivalTime = s.ArrivalTime; DepartureTime = s.DepartureTime; StopTime = s.DepartureTime - s.ArrivalTime; ForceStopSignal = s.ForceStopSignal; OpenLeftDoors = s.OpenLeftDoors; OpenRightDoors = s.OpenRightDoors; DefaultTrackPosition = s.DefaultTrackPosition; StopPosition = stopPosition; StopMode = s.StopMode; Type = s.Type; }
public bool ParseFromString( string _str ) { string[] splitor = { "," } ; string []paramVec = _str.Split( splitor , System.StringSplitOptions.None ) ; // for( int j = 0 ; j < paramVec.Length ; ++j ) // { // Debug.Log( paramVec[ j ] ) ; // } if( paramVec.Length >= 4 ) { int tmpInt = 0 ; if( true == int.TryParse( paramVec[ 0 ] , out tmpInt ) ) { ID = tmpInt ; } DisplayName = paramVec[ 1 ] ; string StationTypeStr = paramVec[ 2 ] ; if( StationTypeStr == StationType.Big.ToString() ) ThisStationType = StationType.Big ; else if( StationTypeStr == StationType.Small.ToString() ) ThisStationType = StationType.Small ; float x = 0 ; float y = 0 ; if( true == float.TryParse( paramVec[ 3 ] , out x ) && true == float.TryParse( paramVec[ 4 ] , out y )) { SetupPos( x , y ) ; } return true ; } return false ; }
public void SetType(string stationText) { stationText = stationText.ToLower().Trim(); StationType type = StationType.Standard; if (stationText == "stream") type = StationType.Stream; else if (stationText == "recording") type = StationType.Recording; else if (stationText == "premium") type = StationType.Premium; else if (stationText == "backup") type = StationType.Backup; else if (stationText == "noassign") type = StationType.NoAssign; this.Type = type; }
public void SendSetStationSubPacket(Guid connectionID, StationType station, bool isSelected) { Send(connectionID, SetStationSubPacket.GetPacket(station, isSelected)); }
public RadioStation(String name, String url, StationType type) { Name = name; Url = url; Type = type; }
public SetStationSubPacket(StationType station, bool isSelected) : base (ShipActionSubPacketType.SetStationSubPacket, (int)station) { IsSelected = isSelected; Station = station; }