Inheritance: MonoBehaviour
コード例 #1
0
        internal BallResult Bowl()
        {
            balls++;

            var modulo = balls % 6;
            currentOverBall = modulo == 0 ? 6 : modulo;
            overs = (balls - currentOverBall) / 6;

            var random = randomNumberGenerator.Next(0, 12);

            current = BallAction.Dot;
            if (random < 9)
            {
                current = (BallAction)random;
            }

            if (IsWicket(current))
            {
                numberOfWickets++;

                if (numberOfWickets == 10)
                {
                    allOut = true;
                }

            }
            else
            {
                totalRuns += (int)current;
            }

            return new BallResult()
            {
                RunCount = totalRuns,
                BallCount = balls,
                WicketCount = numberOfWickets,
                OversCount = overs,
                LastAction = current,
                CurrentOverBallCount = currentOverBall
            };
        }
コード例 #2
0
        public HoldObject(uint identifier, string name, Point3D homePosition, ushort buffId, int groundResetTime, InteractAction onPickupAction, BallAction onDropAction, BallAction onResetAction, BuffQueueInfo.BuffCallbackDelegate onBuffCallback, ushort groundModelId, ushort homeModelId)
        {
            IsActive     = false;
            Identifier   = identifier;
            this.name    = name;
            HomePosition = homePosition;
            BuffId       = buffId;
            //Heading = 1024;

            GroundResetTime = groundResetTime;

            OnPickupAction = onPickupAction;
            OnDropAction   = onDropAction;
            OnResetAction  = onResetAction;
            OnBuffCallback = onBuffCallback;

            GroundModelId = groundModelId;
            HomeModelId   = homeModelId;

            CaptureDuration = 3;
        }
コード例 #3
0
 public Game()
 {
     InitializeComponent();
     BallMovement  = JumpingBall;
     BallMovement += MoveBall;
 }
コード例 #4
0
 public Bomb(uint identifier, string name, Point3D homeLoc, ushort buffId, ushort groundResetTime, InteractAction onPickupAction, BallAction onDropAction, BallAction onResetAction,
             BuffQueueInfo.BuffCallbackDelegate onBuffCallback, ushort groundModelId, ushort homeModelId) : base(identifier, name, homeLoc, buffId, groundResetTime, onPickupAction,
                                                                                                                 onDropAction, onResetAction, onBuffCallback, groundModelId, homeModelId)
 {
     ObjectType = 1;
 }
コード例 #5
0
 public bool IsWicket(BallAction toCheck)
 {
     return toCheck == BallAction.WicketBowled ||
             toCheck == BallAction.WicketCaught ||
             toCheck == BallAction.WicketLbw;
 }
コード例 #6
0
 public ResourceBox(uint identifier, string name, Point3D homePosition, ushort buffId, int groundResetTime, InteractAction onPickupAction, BallAction onDropAction, BallAction onResetAction, BuffQueueInfo.BuffCallbackDelegate onBuffCallback, ushort groundModelId, ushort homeModelId)
     : base(identifier, name, homePosition, buffId, groundResetTime, onPickupAction, onDropAction, onResetAction, onBuffCallback, groundModelId, homeModelId)
 {
     HoldResetTimeSeconds = 360;
 }