-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSolarSystem.cs
38 lines (33 loc) · 942 Bytes
/
SolarSystem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class SolarSystem : MonoBehaviour {
public int state {get; set;}
public List<Planet> planets;
public int numOfBonusTroops{get;set;}
public int playerControlledPlanets{get;set;}
public int playerTurn{get;set;}
public GameObject curPlayer{get;set;}
public List<List<GameObject>> planetPaths;
// Use this for initialization
void Start () {
planetPaths = new List<List<GameObject>>();
}
// Update is called once per frame
void Update () {
}
// NEED TO FIGURE OUT HOW TO INSTANTIATE PLANETS TO CREATE SOLAR SYSTEMS OR
//ADD EXISTING PLANETS TO THE CLOSEST SOLAR SYSTEM PLANE
public int calculateOwnedPlanets()
{
int controledPlanets = 0;
for(int i = 0; i < planets.Count; i++)
{
if(planets[i].isOwned() && planets[i].owningPlayer.name == curPlayer.name)
{
controledPlanets++;
}
}
return controledPlanets;
}
}