本文整理汇总了C#中Token.getAct方法的典型用法代码示例。如果您正苦于以下问题:C# Token.getAct方法的具体用法?C# Token.getAct怎么用?C# Token.getAct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.getAct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TurnList
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.
}
示例2: AddTurnsOfToken
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;
}
}