//
//  SupportingClasses.swift
//  DevourAndDrought
//
//  Created by Micah Gomez on 10/20/21.
//

import Foundation

class resource : Codable {
	
	var name:String = ""
	var cost:Int = 0
	
}

class player : Codable {
	
	var name:String = ""
	var laborpoints:Int = 0
	var oil:Int = 0
	var water:Int = 0
	var wheat:Int = 0
	var corn:Int = 0
	var fish:Int = 0
	var cattle:Int = 0
	var medallions:Int = 0
	
}

struct GlobalVars {
	
	static var playerCount:Int = 2
	static var activePlayerInt:Int = 0
	static var currentYear = -1
	static var players:[player] = []
	static var currentPlayer:player = player()
	static var resourceSlots:[resource] = []
	
	func endTurn() {
		
		
		
	}
	
	func nextPlayer() {
		
		
		
	}
	
	func gameEnd() {
		
		
		
	}
	
	static func newYear() {
		
		for p in GlobalVars.players {
			p.laborpoints = p.laborpoints+6
			if (p.laborpoints > 13){
				p.laborpoints = 13
			}
		}
		GlobalVars.currentYear = GlobalVars.currentYear + 1
		
	}
	
}
