public void ChangeSkill(Guid id, string skill) { RangerShip ranger = _rangers.FirstOrDefault(s => s.ID == id); if (ranger != null && ranger.State == "Active") { switch (skill) { case "HP": ranger.HPCurrent++; ranger.HPRegen += Ship.Mult.HPRegenMult; break; case "MP": ranger.MPCurrent++; ranger.MPRegen += Ship.Mult.MPRegenMult; break; case "Armor": ranger.ArmorCurrent++; break; case "Speed": ranger.SpeedCurrent++; break; case "AngleSpeed": ranger.AngleSpeedCurrent++; break; } ranger.SkillPoints--; } }
public void ChangeWeapon(Guid id, int index) { RangerShip ranger = _rangers.FirstOrDefault(s => s.ID == id); if (ranger != null && ranger.State == "Active") { ranger.WeaponActive = index; } }
public bool DisconnectShip(Guid id) { RangerShip ranger = _rangers.FirstOrDefault(s => s.ID == id); if (ranger != null) { ranger.State = "Inactive"; return(true); } return(false); }
public void UpdateUserShip(Guid id, string propertyName, int propertyValue) { RangerShip ranger = _rangers.FirstOrDefault(s => s.ID == id); if (ranger != null && ranger.State == "Active") { switch (propertyName) { case "VectorMove": ranger.VectorMove = propertyValue; break; case "VectorRotate": ranger.VectorRotate = propertyValue; break; case "VectorShoot": ranger.VectorShoot = propertyValue; break; case "Stealth": ranger.Stealth = propertyValue; break; case "Image": ranger.Image = propertyValue; break; } } }
public void AddRangerShip(RangerShip ranger) { _rangers.Add(ranger); BombsBuffer.Add(ranger.ID, new ConcurrentBag <Bomb>()); // Key: ship.id; Value: bombs concurrent collection }
public void UpdateUserName(Guid id, string name) { RangerShip oldRanger = _rangers.FirstOrDefault(s => s.ID == id); oldRanger.Name = name; }