public bool ShowComponent(SensorComponents component, bool visibility) { switch ((int)component) { case 0: { this.com_scroll_100.Visible = com_scroll_50.Visible = visibility; this.com_oper_100.Visible = this.com_oper_50.Visible = visibility; this.com_add_100.Visible = this.com_add_50.Visible = visibility; this.com_search_100.Visible = this.com_search_100.Visible = visibility; break; } case 1: { this.com_scroll_100.Visible = com_scroll_50.Visible = visibility; break; } case 2: { this.com_oper_100.Visible = this.com_oper_50.Visible = visibility; break; } case 4: { this.com_add_100.Visible = this.com_add_50.Visible = visibility; break; } case 8: { this.com_search_100.Visible = this.com_search_50.Visible = visibility; break; } } return(visibility); }
public void Clean(Game game) { foreach (var component in LevelComponents.Where(b => b.GameId == game.Id)) { LevelComponents.Remove(component); } foreach (var branch in Branches.Where(b => b.GameId == game.Id)) { Branches.Remove(branch); } foreach (var logEntry in LogEntries.Where(e => e.GameId == game.Id)) { LogEntries.Remove(logEntry); } foreach (var playerCommand in PlayerCommands.Where(b => b.GameId == game.Id)) { PlayerCommands.Remove(playerCommand); } foreach (var abilityComponent in AbilityComponents.Where(b => b.GameId == game.Id)) { AbilityComponents.Remove(abilityComponent); } foreach (var aiComponent in AIComponents.Where(b => b.GameId == game.Id)) { AIComponents.Remove(aiComponent); } foreach (var playerComponent in PlayerComponents.Where(b => b.GameId == game.Id)) { PlayerComponents.Remove(playerComponent); } foreach (var beingComponent in BeingComponents.Where(b => b.GameId == game.Id)) { BeingComponents.Remove(beingComponent); } foreach (var physicalComponent in PhysicalComponents.Where(b => b.GameId == game.Id)) { PhysicalComponents.Remove(physicalComponent); } foreach (var raceComponent in RaceComponents.Where(b => b.GameId == game.Id)) { RaceComponents.Remove(raceComponent); } foreach (var effectComponent in EffectComponents.Where(b => b.GameId == game.Id)) { EffectComponents.Remove(effectComponent); } foreach (var itemComponent in ItemComponents.Where(b => b.GameId == game.Id)) { ItemComponents.Remove(itemComponent); } foreach (var knowledgeComponent in KnowledgeComponents.Where(b => b.GameId == game.Id)) { KnowledgeComponents.Remove(knowledgeComponent); } foreach (var connectionComponent in ConnectionComponents.Where(b => b.GameId == game.Id)) { ConnectionComponents.Remove(connectionComponent); } foreach (var positionComponent in PositionComponents.Where(b => b.GameId == game.Id)) { PositionComponents.Remove(positionComponent); } foreach (var sensorComponent in SensorComponents.Where(b => b.GameId == game.Id)) { SensorComponents.Remove(sensorComponent); } game.ActingPlayerId = null; SaveChanges(); Games.Remove(game); SaveChanges(); }
public bool GetComponentVisiblity(SensorComponents component) { bool visibility = false; switch ((int)component) { case 1: { if (this._sensorType == 100) { visibility = this.com_scroll_100.Visible; } else { visibility = this.com_scroll_50.Visible; } break; } case 2: { if (this._sensorType == 100) { visibility = this.com_oper_100.Visible; } else { visibility = this.com_oper_50.Visible; } break; } case 4: { if (this._sensorType == 100) { visibility = this.com_add_100.Visible; } else { visibility = this.com_add_50.Visible; } break; } case 8: { if (this._sensorType == 100) { visibility = this.com_search_100.Visible; } else { visibility = this.com_search_50.Visible; } break; } default: { break; } } return(visibility); }
public bool GetComponentVisiblity(SensorComponents component) { bool visibility = false; switch ((int)component) { case 1: { if (this._sensorType == 100) visibility = this.com_scroll_100.Visible; else visibility = this.com_scroll_50.Visible; break; } case 2: { if (this._sensorType == 100) visibility = this.com_oper_100.Visible; else visibility = this.com_oper_50.Visible; break; } case 4: { if (this._sensorType == 100) visibility = this.com_add_100.Visible; else visibility = this.com_add_50.Visible; break; } case 8: { if (this._sensorType == 100) visibility = this.com_search_100.Visible; else visibility = this.com_search_50.Visible; break; } default: { break; } } return visibility; }
public bool ShowComponent(SensorComponents component, bool visibility) { switch ((int)component) { case 0: { this.com_scroll_100.Visible = com_scroll_50.Visible = visibility; this.com_oper_100.Visible = this.com_oper_50.Visible = visibility; this.com_add_100.Visible = this.com_add_50.Visible = visibility; this.com_search_100.Visible = this.com_search_100.Visible = visibility; break; } case 1: { this.com_scroll_100.Visible = com_scroll_50.Visible = visibility; break; } case 2: { this.com_oper_100.Visible = this.com_oper_50.Visible = visibility; break; } case 4: { this.com_add_100.Visible = this.com_add_50.Visible = visibility; break; } case 8: { this.com_search_100.Visible = this.com_search_50.Visible = visibility; break; } } return visibility; }