1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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<ServicePlayer> playerList;
- public CrystalBaseData(int id)
- {
- this.id = id;
- playerList = new List<ServicePlayer>();
- }
- 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();
- }
- }
- }
- }
|