//Solo recibe objetos de la clase AirVehicle public void SaveFirePokemon(FirePokemon firePokemon) { var searchResult = FireList.Where(p => p.Name == firePokemon.Name).ToList(); //if it didnt find any coincidence, then searchresult is null if (searchResult.Count() > 0) { throw new Exception("pokemon already stored"); } else { //otherwise it stores the pokemon successfully FireList.Add(firePokemon); } }
private void Dashboard_Load(object sender, EventArgs e) { this.txtGameTestEnvironment.Text = Guid.NewGuid().ToString(); this.FAppPublic = new FirebaseApp(new Uri(FBPATHPUBLIC + this.txtGameTestEnvironment.Text + "/"), SECRET); this.FAppPrivate = new FirebaseApp(new Uri(FBPATHPRIVATE + this.txtGameTestEnvironment.Text + "/"), SECRET); // Main this.fdPlayers = new FireList(this.FAppPrivate, typeof(Player), this, new FireListBox(lbxPlayers)); this.fdGames = new FireList(this.FAppPublic, typeof(Game), this, new FireListBox(lbxGames), initWithCache: false); this.fdCommands = new FireList(this.FAppPrivate, typeof(GameCommand), this, new FireListBox(lbxCommands)); // Communication between Players this.flPlayerGames = new FireList(this.FAppPrivate, typeof(PlayerGame), this, new FireListBox(lbxPlayerGames)); //contains the state of one player in one game this.flPlayerUnits = new FireList(this.FAppPrivate, typeof(PlayerUnit), this, new FireListBox(lbxPlayerUnits)); this.flPlayerTiles = new FireList(this.FAppPrivate, typeof(PlayerMapTile), this); }
private void InitListeners() { //These lists automatically get updated when data in database changes, also see region #IFireDelegate //Players (should be one) this.flPlayers = new FireList(this.FAppPrivate, typeof(Player), this, new FireListBox(lbxPlayers), userId: me.Id); //Games this.flGames = new FireList(this.FAppPublic, typeof(Game), this, new FireListBox(lbxGames)); //Commands this.flCommands = new FireList(this.FAppPrivate, typeof(GameCommand), this, new FireListBox(lbxCommands), userId: me.Id); //PlayerGames (should be only one for now) this.flPlayerGames = new FireList(this.FAppPrivate, typeof(PlayerGame), this, new FireListBox(lbxMyGames), userId: me.Id); //Feedback based from server this.flCommandFeedback = new FireList(this.FAppPrivate, typeof(CommandFeedback), this, new FireListBox(lbxCommandFeedback), userId: me.Id); //All visible maptiles this.flPlayerMapTiles = new FireList(this.FAppPrivate, typeof(PlayerMapTile), this, userId: me.Id); }
private void Dashboard_Load(object sender, EventArgs e) { this.txtGameTestEnvironment.Text = Guid.NewGuid().ToString(); this.FAppPublic = new FirebaseApp(new Uri(FBPATHPUBLIC + this.txtGameTestEnvironment.Text+"/"), SECRET); this.FAppPrivate = new FirebaseApp(new Uri(FBPATHPRIVATE + this.txtGameTestEnvironment.Text + "/"), SECRET); // Main this.fdPlayers = new FireList(this.FAppPrivate, typeof(Player), this, new FireListBox(lbxPlayers)); this.fdGames = new FireList(this.FAppPublic, typeof(Game), this, new FireListBox(lbxGames), initWithCache: false); this.fdCommands = new FireList(this.FAppPrivate, typeof(GameCommand), this, new FireListBox(lbxCommands)); // Communication between Players this.flPlayerGames = new FireList(this.FAppPrivate, typeof(PlayerGame), this, new FireListBox(lbxPlayerGames)); //contains the state of one player in one game this.flPlayerUnits = new FireList(this.FAppPrivate, typeof(PlayerUnit), this, new FireListBox(lbxPlayerUnits)); this.flPlayerTiles = new FireList(this.FAppPrivate, typeof(PlayerMapTile), this); }