示例#1
0
文件: Point.cs 项目: KokiOishi/Volley
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Volley.Points.Point`1"/> class.
 /// </summary>
 /// <param name="pointKind">Point kind.</param>
 /// <param name="winnerTeam">Winner team.</param>
 /// <param name="shotKind">Shot kind.</param>
 /// <param name="side"></param>
 /// <param name="receives">Recieves performed.</param>
 protected Point(PointKinds pointKind, TTeam winnerTeam, ShotKind shotKind, HandSide side, IEnumerable <Receive> receives)
 {
     PointKind  = pointKind;
     WinnerTeam = winnerTeam ?? throw new ArgumentNullException(nameof(winnerTeam));
     ShotKind   = shotKind;
     Side       = side;
     Receives   = receives?.ToArray() ?? throw new ArgumentNullException(nameof(receives));
 }
 void DoPlayerShoot(int r, ShotKind kind)
 {
     if (row == r && col == 0 && shot_state == ShotKind.None)
     {
         Debug.Log("Player Shot " + r + " " + kind.ToString());
         shot_state = kind;
         UpdateBunnies();
     }
 }
 void DoBossShoot(int r)
 {
     if (row == r && col == 3 && boss_shot_state == ShotKind.None)
     {
         Debug.Log("Boss Shot " + r);
         boss_shot_state = ShotKind.Sword;
         UpdateBunnies();
     }
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Volley.Points.PointWinner`1"/> class.
 /// </summary>
 /// <param name="pointKind">Point kind.</param>
 /// <param name="winnerTeam">Winner team.</param>
 /// <param name="shotKind">Shot kind to win the point.</param>
 /// <param name="numberRallies">Number of rallies.</param>
 /// <param name="actualWinner">Actual winner.</param>
 /// <param name="side">Side won the point.</param>
 public PointWinner(PointKinds pointKind, TTeam winnerTeam, ShotKind shotKind, HandSide side, IEnumerable <Receive> receives, Player actualWinner)
     : base(pointKind, winnerTeam, shotKind, side, receives)
 {
     ActualWinner = actualWinner ?? throw new ArgumentNullException(nameof(actualWinner));
     if (!winnerTeam.AllPlayers.Contains(actualWinner))
     {
         throw new ArgumentException($"{nameof(actualWinner)} must be one of the {nameof(winnerTeam)}!", nameof(actualWinner));
     }
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Volley.Points.PointError`1"/> class.
 /// </summary>
 /// <param name="winnerTeam">Winner team.</param>
 /// <param name="shotKind">Shot kind that <paramref name="winnerTeam"/> won the point.</param>
 /// <param name="numberRallies">Number of rallies.</param>
 /// <param name="erroredPlayer">The player errored.</param>
 /// <param name="forced">The value which indicates whether the <paramref name="erroredPlayer"/> is forced to error.</param>
 public PointError(TTeam winnerTeam, ShotKind shotKind, HandSide side, IEnumerable <Receive> receives, Player erroredPlayer, bool forced)
     : base(forced ? PointKinds.ForcedError : PointKinds.UnforcedError, winnerTeam, shotKind, side, receives)
 {
     ErroredPlayer = erroredPlayer ?? throw new ArgumentNullException(nameof(erroredPlayer));
     if (winnerTeam.AllPlayers.Contains(erroredPlayer))
     {
         throw new ArgumentException($"{nameof(erroredPlayer)} must not be one of the {nameof(winnerTeam)}!", nameof(erroredPlayer));
     }
     Forced = forced;
 }
 void SpawnBoss(int r, ShotKind kind)
 {
     if (row == r)
     {
         state = kind;
         foreach (SpriteRenderer rend in renderers.Values)
         {
             if (rend.gameObject.name == kind.ToString())
             {
                 rend.enabled = true;
             }
         }
     }
 }
 void DoPlayerBulletTick(List <RowInfo> rows)
 {
     if (col == 3 && state != BunnyState.Off)
     {
         //GameManager._instance.LifeDown();
     }
     else if (col > 0)
     {
         //Debug.Log("Moving boss shots, " + state.ToString() + " -> " + rows[row].bunnies[col - 1].ToString());
         shot_state = rows[row].shots[col - 1];
     }
     else
     {
         shot_state = ShotKind.None;
     }
 }
示例#8
0
 /// <summary>
 /// TODO:XML DOCUMENT
 /// </summary>
 /// <param name="receivedPlayer"></param>
 /// <param name="side"></param>
 /// <param name="kind"></param>
 public Receive(Player receivedPlayer, HandSide side, ShotKind kind)
 {
     ReceivedPlayer = receivedPlayer;
     Side           = side;
     Kind           = kind;
 }