1.Commit
This commit is contained in:
94
Assets/Scripts/PlayerManager.cs
Normal file
94
Assets/Scripts/PlayerManager.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class PlayerManager
|
||||
{
|
||||
// Contains all star systems of player
|
||||
//private List<GameObject> starSystems = new List<GameObject>();
|
||||
|
||||
// Contains all fleets of player
|
||||
//private List<GameObject> fleets = new List<GameObject>();
|
||||
|
||||
private ScienceManager _scienceManager;
|
||||
|
||||
public int ScienceAcumulated; // this int has to be moved to player manager later
|
||||
|
||||
public enum PlayerColor
|
||||
{
|
||||
None,
|
||||
Red,
|
||||
Blue,
|
||||
Green,
|
||||
Yellow
|
||||
}
|
||||
|
||||
public PlayerColor PlayerColor2
|
||||
{
|
||||
get
|
||||
{
|
||||
return _playerColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
_playerColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
private PlayerColor _playerColor;
|
||||
|
||||
|
||||
// Player values
|
||||
public PlayerValues PlayerAttributes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_playerAttributes == null)
|
||||
{
|
||||
_playerAttributes = new PlayerValues();
|
||||
}
|
||||
return new PlayerValues();
|
||||
}
|
||||
set
|
||||
{
|
||||
_playerAttributes = value;
|
||||
}
|
||||
}
|
||||
|
||||
private PlayerValues _playerAttributes;
|
||||
|
||||
public PlayerManager(ScienceManager sm)
|
||||
{
|
||||
this._scienceManager = sm;
|
||||
this._playerAttributes = new PlayerValues();
|
||||
}
|
||||
|
||||
// Called by clock over game manager, once per day
|
||||
public void simulateDay()
|
||||
{
|
||||
//if (starSystems != null)
|
||||
//{
|
||||
// Add resources for each part of each starSystem which belongs to this player
|
||||
//foreach (var starSystem in starSystems)
|
||||
//{
|
||||
// int playerID = this._playerAttributes.id;
|
||||
// // StarSystem.getComponent<Script>().getMoney();
|
||||
// this._playerAttributes.money += (1 + ScienceManager.repeatableWealth) * ((StarSystem)starSystem).getMoney(playerID);
|
||||
|
||||
// this._playerAttributes.science += ((StarSystem)starSystem).getScience(playerID);
|
||||
// this._playerAttributes.power += ((StarSystem)starSystem).getPower(playerID);
|
||||
// this._playerAttributes.food += ((StarSystem)starSystem).getFood(playerID);
|
||||
// this._playerAttributes.industrialCapacity += ((StarSystem)starSystem).getIC(playerID);
|
||||
this._playerAttributes.science += 5;
|
||||
_scienceManager.UpdateScience(this._playerAttributes.science);
|
||||
this._playerAttributes.science = _scienceManager.PublicScienceAcumulated;
|
||||
//}
|
||||
//}
|
||||
}
|
||||
|
||||
// Deletes overhanded referrence from fleets list
|
||||
// If not null
|
||||
//public void deleteFleet(ref GameObject fleet)
|
||||
//{
|
||||
// this.fleets.Remove(fleet);
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user