public TurnList(Token theToken) { int period = GameControllerScript.ENDTIME / theToken.getAct(); int nextTime = period; for (int loopTime = GameControllerScript.time; nextTime <= GameControllerScript.ENDTIME;) //Note: This doesn't check for bottom bound. We'd need to retweak it later. { Turn tempTurn = new Turn(theToken, nextTime); this.AddTurn(tempTurn); nextTime += period; } //Initializing the listener. Token.MakeNewTurns += AddTurnsOfToken; //Each TurnList that gets made will listen out for the thingy. //Though this is supposed to be a Singleton. Should add preventative measures to prevent making more than one. }
public void AddTurnsOfToken(Token theToken) { /* DELETE THIS BIG BLOCK COMMENT this.AddTurn(nickname = theToken.getName()); //This version of a term gives an incorrect turn, but will work for now. float period = GameControllerScript.ENDTIME / myToken.getAct(); //How long it takes for this to get one action. 1000/1= 1000. Which would get it exactly one turn at the end of the day. //1000/10 = 100. Fill the time bar with this and they would get 10 turns. time = (int)period; //In this case, we're just assuming the earliest possible turn the ACT can give is the only one we're going to make use of. END OF DELETEME*/ int period = GameControllerScript.ENDTIME / theToken.getAct(); int nextTime = period; for (int loopTime = GameControllerScript.time; nextTime <= GameControllerScript.ENDTIME;) //Note: This doesn't check for bottom bound. We'd need to retweak it later. { Turn tempTurn = new Turn(theToken, nextTime); this.AddTurn(tempTurn); nextTime += period; } }