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 }; }
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; }
public Game() { InitializeComponent(); BallMovement = JumpingBall; BallMovement += MoveBall; }
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; }
public bool IsWicket(BallAction toCheck) { return toCheck == BallAction.WicketBowled || toCheck == BallAction.WicketCaught || toCheck == BallAction.WicketLbw; }
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; }