示例#1
0
    public static void main()
    {
        global::Game newGame    = new global::Game();
        string       line       = ((global::haxe.io.Input)(new global::cs.io.NativeInput(((global::System.IO.Stream)(global::System.Console.OpenStandardInput()))))).readLine();
        global::Move playerMove = ((global::Move)(global::Type.createEnum <object>(((global::System.Type)(typeof(global::Move))), ((string)(line)), default(global::Array))));

        newGame.start(playerMove);
    }
示例#2
0
 public Move(global::Move mov)
 {
     CardId   = mov.CardId;
     Position = mov.Position;
 }
 public virtual global::System.Threading.Tasks.Task <global::Acknowledgement> submitMove(global::Move request, grpc::ServerCallContext context)
 {
     throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
 }
 public virtual grpc::AsyncUnaryCall <global::Acknowledgement> submitMoveAsync(global::Move request, grpc::CallOptions options)
 {
     return(CallInvoker.AsyncUnaryCall(__Method_submitMove, null, options, request));
 }
 public virtual grpc::AsyncUnaryCall <global::Acknowledgement> submitMoveAsync(global::Move request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(submitMoveAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
 public virtual global::Acknowledgement submitMove(global::Move request, grpc::CallOptions options)
 {
     return(CallInvoker.BlockingUnaryCall(__Method_submitMove, null, options, request));
 }
示例#7
0
    public virtual void start(global::Move move)
    {
        unchecked {
            object playerA              = new global::haxe.lang.DynamicObject(new int[] { 1214309137, 1224700491 }, new object[] { move, "Simon" }, new int[] {}, new double[] {});
            global::System.Type e       = typeof(global::Move);
            global::Move        playerB = null;
            if (!(global::haxe.lang.Runtime.typeEq(e, null)))
            {
                global::Array <object> arr = global::Type.allEnums <object>(((global::System.Type)(e)));
                playerB = ((((arr != null) && (arr.length > 0))) ? (((global::Move)(arr[((int)(global::System.Math.Floor(((double)(((((arr.length - 1) + 1)) * global::Math.rand.NextDouble()))))))]))) : (null));
            }
            else
            {
                playerB = null;
            }

            object         playerB1 = new global::haxe.lang.DynamicObject(new int[] { 1214309137, 1224700491 }, new object[] { playerB, "Nicolas" }, new int[] {}, new double[] {});
            global::Result result   = null;
            global::Move   _g       = ((global::Move)(global::haxe.lang.Runtime.getField(playerB1, "move", 1214309137, true)));
            switch (((global::Move)(global::haxe.lang.Runtime.getField(playerA, "move", 1214309137, true)))._hx_index)
            {
            case 0:
            {
                if ((_g == null))
                {
                    result = global::Result.Draw;
                }
                else
                {
                    switch (_g._hx_index)
                    {
                    case 1:
                    {
                        result = global::Result.Winner(playerB1);
                        break;
                    }


                    case 2:
                    {
                        result = global::Result.Winner(playerA);
                        break;
                    }


                    default:
                    {
                        result = global::Result.Draw;
                        break;
                    }
                    }
                }

                break;
            }


            case 1:
            {
                if ((_g == null))
                {
                    result = global::Result.Draw;
                }
                else
                {
                    switch (_g._hx_index)
                    {
                    case 0:
                    {
                        result = global::Result.Winner(playerA);
                        break;
                    }


                    case 2:
                    {
                        result = global::Result.Winner(playerB1);
                        break;
                    }


                    default:
                    {
                        result = global::Result.Draw;
                        break;
                    }
                    }
                }

                break;
            }


            case 2:
            {
                if ((_g == null))
                {
                    result = global::Result.Draw;
                }
                else
                {
                    switch (_g._hx_index)
                    {
                    case 0:
                    {
                        result = global::Result.Winner(playerB1);
                        break;
                    }


                    case 1:
                    {
                        result = global::Result.Winner(playerA);
                        break;
                    }


                    default:
                    {
                        result = global::Result.Draw;
                        break;
                    }
                    }
                }

                break;
            }
            }

            global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("result: ", global::Std.@string(result)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "start", "Game", "src/Main.hx" }, new int[] { 1981972957 }, new double[] { ((double)(25)) }));
        }
    }