/// <summary> /// Fill a list of classes of all of the players in a team /// </summary> /// <param name="TeamID">The ID of the team</param> /// <returns>a list of classes of all of the players in a team</returns> public static List <Classes.Player> Fill(int TeamID) { List <Classes.Player> PlayerList = new List <Classes.Player>(); //add data from team table try { OleDbCommand command; command = new OleDbCommand("SELECT Staff.StaffID, Staff.Forename, Staff.Surname, Staff.DOB, Staff.Role FROM Staff INNER JOIN StaffEmployed ON Staff.StaffID = StaffEmployed.StaffID WHERE(((StaffEmployed.TeamID) = @varTeamID) AND((StaffEmployed.Active) = True)); ", DatabaseConnection.DBConnection); command.Parameters.Add(new OleDbParameter("@varTeamID", TeamID)); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { Classes.Player Player = new Classes.Player(); Player.PlayerID = Int32.Parse(reader[0].ToString()); Player.Forname = reader[1].ToString(); Player.Surname = reader[2].ToString(); Player.DateOfBirth = DateTime.Parse(reader[3].ToString()); Player.Role = reader[4].ToString(); PlayerList.Add(Player); } } catch (OleDbException exception) { MessageBox.Show(exception.Message, "OleDb Exception"); } return(PlayerList); }
public override void Collect(Classes.Player player) { // Give player the ability to cast Blink. player.ReceiveBuff((Spells.Buff)player.GetSpell("Health")); player.CastSpell("Health"); this.GetUI(player).SetSpellText("Health Shield", 1); GameObject.Instantiate(Resources.Load("Effects\\GreenEffect"), player.transform.position, Quaternion.identity); }
public override void Collect(Classes.Player player) { Powerups.Powerup powerup = this.ChoosePowerup(Random.Range(1, 6)); if (powerup != null) { powerup.Collect(player); } }
public override void Collect(Classes.Player player) { Spells.InvertGravity invert = (Spells.InvertGravity)player.GetSpell("InvertGravity"); player.ReceiveBuff(invert); invert.Cast(); this.GetUI(player).SetSpellText("Invert Gravity", 1); GameObject.Instantiate(Resources.Load("Effects\\PurpleEffect"), player.transform.position, Quaternion.identity); }
public override void Collect(Classes.Player player) { // Give player the ability to cast Blink. Spells.Blink blink = (Spells.Blink)player.GetSpell("Blink"); player.ReceiveBuff(blink); this.GetUI(player).SetSpellText("Blink", 5); GameObject.Instantiate(Resources.Load("Effects\\BlueEffect"), player.transform.position, Quaternion.identity); }
public PlayerPage(string strPseudo) { InitializeComponent(); // Création jeu game = new Classes.Game(); // Création joueur player1 = new Classes.Player(strPseudo, 1, GetSQuare("depart")); // Initialisation affichage InitInfosPlayer(); }
// Use this for initialization void Start() { this.healthSlider.value = this.healthSlider.maxValue; this.player = this.playerObj.GetComponent <Classes.Player>(); this.blink = (Spells.Blink) this.player.GetSpell("Blink"); this.laser = (Spells.Laser) this.player.GetSpell("Laser"); this.invuln = (Spells.Invulnerability) this.player.GetSpell("Invulnerability"); this.shield = (Spells.Health) this.player.GetSpell("Health"); this.gravity = (Spells.InvertGravity) this.player.GetSpell("InvertGravity"); this.ToggleSpellUI(false); }
public override void Collect(Classes.Player player) { // Give player the ability to cast Blink. Spells.Invulnerability invulnerability = (Spells.Invulnerability)player.GetSpell("Invulnerability"); player.ReceiveBuff(invulnerability); invulnerability.Cast(); invulnerability.SetCharges(1); this.GetUI(player).SetSpellText("Invulnerability", 1); GameObject.Instantiate(Resources.Load("Effects\\BlackEffect"), player.transform.position, Quaternion.identity); }
void Start() { this.biped = GetComponent <Objects.Player>(); this.player = GetComponent <Classes.Player>(); // XXX Set this in Unity Input manager. this.fixedQueue = new Queue <System.Action>(); this.controller = new Internal.InputController(); this.controller.RegisterMouse(1, this.BlinkAction); this.controller.RegisterMouse(0, this.LaserAction); this.controller.RegisterKey(KeyCode.Space, this.JumpAction); }
public void UpdateUI(Classes.Player player) { if (player.GetHealth() != this.lastHealthValue) { this.lastHealthValue = player.GetHealth(); this.healthSlider.value = this.lastHealthValue; } if (this.player.HasBuff("Blink")) { this.SetSpellText("Blink", this.blink.GetChargesLeft()); } else if (this.player.HasBuff("Laser")) { this.SetSpellTimerText("Laser", (int)this.laser.GetTimeLeft()); } else if (this.player.HasBuff("InvertGravity")) { this.SetSpellTimerText("InvertGravity", (int)this.gravity.GetTimeLeft()); } else if (this.player.HasBuff("Invulnerability")) { this.SetSpellTimerText("Invulnerability", (int)this.invuln.GetTimeLeft()); } else if (this.player.HasBuff("Health")) { this.SetSpellTimerText("Health Shield", (int)this.shield.GetTimeLeft()); } else if (this.player.GetActiveBuffs().Count == 0) { this.ToggleSpellUI(false); } }
public IActionResult Player(string _user) { //TODO //add a check db for name already exists //if exists grab ID and move on //else create player var Player = new Classes.Player(); Player.Hand = new Hand(new List <Card>()); Player.Foot = new Hand(new List <Card>()); var plaYA = new Models.Player(); plaYA.Name = _user; plaYA.Hand = Player.Hand.SerializeHand(); plaYA.Foot = Player.Foot.SerializeHand(); plaYA.Books = ""; //send this player to the Players table pass on username _context.Players.Add(plaYA); _context.SaveChanges(); return(RedirectToAction("Index", "GameTable", new { _user }));//create game or join game page, send the player object }
protected MenuUI.PlayerUI GetUI(Classes.Player player) { GameObject obj = GameObject.FindGameObjectWithTag("UI"); return(obj.GetComponentInParent <MenuUI.PlayerUI>()); }
public abstract void Collect(Classes.Player player);
public virtual void Collect(Classes.Player player) { player.GetComponent <Scoreboard>().RegisterItemCollected(); }