package model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import model.unit.Unit;

public class Player implements ModelConstants{
	
	private String myName;
	private HashMap<String,Double> myResources;
	private List<Unit> myUnits;
	
	public Player(){
		this(DEFAULT_NAME);
	}
	
	public Player(String name){
		myName = name;
		myResources = new HashMap<String,Double>();
		myUnits = new ArrayList<Unit>();
	}
	
	public String setName(String name){
		myName = name;
		return myName;
	}
	
	public String getName(){
		return myName;
	}
	
	public void addNewResourceType(String resourceType){
		myResources.put(resourceType,0.0);
	}
	
	// Use negative value for amount to 'charge' the player.
	public boolean adjustResources(String resourceType, double amount){
		double finalResources = myResources.get(resourceType)+amount;
		if(finalResources>0){
			myResources.put(resourceType, myResources.get(resourceType)+amount);
			return true;
		}
		return false;
	}
	
	public List<Unit> getAllUnits(){
		return myUnits;
	}
	

}

@@ -87,16 +87,50 @@
 .List;%0A%0A
+import model.condition.Condition;%0A
 import m
@@ -293,16 +293,55 @@
 yUnits;%0A
+%09private Condition myWinningCondition;%0A
 %09%0A%09publi
@@ -1115,12 +1115,96 @@
 ts;%0A%09%7D%0A%09
+%0A%09public boolean checkWinningCondition() %7B%0A%09%09return myWinningCondition.check();%0A%09%7D%0A%09
 %0A%0A%7D%0A

Change made to Player class