using UnityEngine; using System.Collections; using System.Collections.Generic; public class CrystalBaseData { public const int maxPowerLevel = 5; public int id; public int teamId; public int powerLevel; public bool occupied; public List playerList; public CrystalBaseData(int id) { this.id = id; playerList = new List(); } public void powerLevelChange(int teamId) { if(this.teamId == TeamUtil.Team.None.GetHashCode() || this.teamId == teamId) { if(this.teamId == TeamUtil.Team.None.GetHashCode()) { this.teamId = teamId; } powerLevel++; if(powerLevel >= maxPowerLevel) { powerLevel = maxPowerLevel; if(!occupied) { occupied = true; } } } else { powerLevel--; if(powerLevel <= 0) { this.teamId = TeamUtil.Team.None.GetHashCode(); } } } }