Esempio n. 1
0
        private string GenerateMacro(OrbAssignment assignment, List <OrbAssignment> allAssignments)
        {
            if (assignment.Role == OrbRole.Thrower)
            {
                return(null);
            }

            var oppositeSide = assignment.Side == OrbSide.Left ? OrbSide.Right : OrbSide.Left;
            var otherCatcher = allAssignments.FirstOrDefault(a => a.Set == assignment.Set && a.Side == oppositeSide && a.Role == OrbRole.Catcher);

            var nextSet     = assignment.Set == 5 ? 1 : assignment.Set + 1;
            var nextCatcher = allAssignments.FirstOrDefault(a => a.Set == nextSet && a.Side == assignment.Side && a.Role == OrbRole.Catcher);
            var nextThrower = allAssignments.FirstOrDefault(a => a.Set == nextSet && a.Side == assignment.Side && a.Role == OrbRole.Thrower);

            var result = new StringBuilder();

            if (otherCatcher?.Player?.Name != null)
            {
                result.Append($"/w {otherCatcher.Player.FullyQualifiedName} orb ready");
                result.Append('\n');
            }

            if (nextCatcher?.Player?.Name != null)
            {
                result.Append($"/w {nextCatcher.Player.FullyQualifiedName} youre next");
                result.Append('\n');
            }

            if (nextThrower?.Player?.Name != null)
            {
                result.Append($"/w {nextThrower.Player.FullyQualifiedName} youre next");
            }

            return(result.ToString().Trim(Environment.NewLine.ToCharArray()));
        }
Esempio n. 2
0
        private object HardestRuns(OrbAssignment assignment)
        {
            var gateOnCloseLeft  = GatewayAssignment.Side[OrbSide.Left].Position[GatewayPosition.Close] != null;
            var gateOnCloseRight = GatewayAssignment.Side[OrbSide.Right].Position[GatewayPosition.Close] != null;

            if (assignment.Side == OrbSide.Left)
            {
                return(gateOnCloseLeft ? 1 : 0);
            }
            else
            {
                return(gateOnCloseRight ? 1 : 0);
            }
        }