public Scenario GenerateScenario() { var role1 = RoleValue.FromRandom(); var role2 = RoleValue.FromRandom(role1); var role3 = RoleValue.FromRandom(role1, role2); return(Scenario.Lose(new RoleSet(role1, role2, role3))); }
public Scenario GenerateScenario() { //リーチする役を決定 RoleValue reachRole = RoleValue.FromRandom(); //外れる役を決定 RoleValue loseRole = RoleValue.FromRandom(reachRole); //リーチ後に当たるかはずれるかを決定 bool isWin = UnityEngine.Random.value < reachToWinProbability; //リーチ後の確定役を決定 RoleValue afterReachRole; //あたりなら揃える if (isWin) { afterReachRole = reachRole; } //ハズレならその前の役にする else { afterReachRole = reachRole.Previous; } //はずれる位置を決定 switch (UnityEngine.Random.Range(0, 3)) { case 0: return(Scenario.Reach(new RoleSet(loseRole, reachRole, reachRole), afterReachRole)); case 1: return(Scenario.Reach(new RoleSet(reachRole, loseRole, reachRole), afterReachRole)); case 2: return(Scenario.Reach(new RoleSet(reachRole, reachRole, loseRole), afterReachRole)); default: throw new Exception("リーチの位置を決定できませんでした"); } }
public Scenario GenerateScenario() { return(Scenario.DirectWin(RoleValue.FromRandom())); }