Esempio n. 1
0
        //GameEvents eventTable = new GameEvents();

        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="context"></param>
        internal GameMaster(GameContext context, ICardDistributer cardDistributer = null)
        {
            this.context    = context;
            monitorCtx      = new BaseMonitorContext(context, _getAllDeck);
            IsPlaing        = false;
            CardDistributer = cardDistributer ?? new DefaultCardDistributer();
        }
Esempio n. 2
0
        internal static Object PreviewNode(ContentFilter node, IMonitorContext monitor, ILogger logger)
        {
            if (node == null)
            {
                return(null);
            }

            return(node._EvaluatePreview(monitor, logger));
        }
Esempio n. 3
0
        internal static Object DebugNode(ContentFilter node, IMonitorContext monitor, ILogger logger)
        {
            #if DEBUG
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Launch();
            }
            #endif

            return(EvaluateNode(node, monitor, logger));
        }
Esempio n. 4
0
 public ProtocolData(int playerNum, string kind, IMonitorContext ctx)
 {
     _data = new
     {
         YourNum    = playerNum,
         Kind       = kind,
         Teban      = ctx.GameContext.Teban,
         IsKakumei  = ctx.GameContext.IsKakumei,
         PlayerInfo = ctx.GameContext.PlayerInfo,
         AllDeck    = ctx.AllDeck.Select(deck => deck.ToCardsetString()),
         Ba         = ctx.GameContext.Ba.Select(cards => cards.ToCardsetString()),
         Yama       = ctx.GameContext.Yama.JoinString(" "),
         History    = ctx.GameContext.History.Select(gh => gh.ToString()),
     };
 }
Esempio n. 5
0
            internal Object _EvaluateObject(IMonitorContext monitor, ILogger logger)
            {
                if (BuildContext == null)
                {
                    throw new InvalidOperationException($"{this.GetType().Name} not initialized");
                }

                _MonitorContext = monitor;
                _Logger         = logger;

                var r = EvaluateObject();

                _Logger         = null;
                _MonitorContext = null;

                return(r);
            }
Esempio n. 6
0
            internal Object _EvaluatePreview(IMonitorContext monitor, ILogger logger)
            {
                if (BuildContext == null)
                {
                    throw new InvalidOperationException($"{this.GetType().Name} not initialized");
                }

                var previewContext = BuildContext.GetPreviewContext();

                if (previewContext == null)
                {
                    throw new InvalidOperationException($"{nameof(PreviewContext)} is Null");
                }

                _MonitorContext = monitor;
                _Logger         = logger;

                var r = EvaluatePreview(previewContext);

                _Logger         = null;
                _MonitorContext = null;

                return(r);
            }
Esempio n. 7
0
 public void CardDistributed(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "CardDistributed", ctx));
 }
Esempio n. 8
0
 public void Kakumei(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "Kakumei", ctx));
 }
Esempio n. 9
0
 public void Agari(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "Agari", ctx));
 }
Esempio n. 10
0
 public void Nagare(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "Nagare", ctx));
 }
Esempio n. 11
0
 public void CardsArePut(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "CardsArePut", ctx));
 }
Esempio n. 12
0
 public void Finish(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "Finish", ctx));
 }
Esempio n. 13
0
        // =================================== Game Events ===================================

        public void Start(IMonitorContext ctx)
        {
            Send(new Neof5Protocols.ProtocolData(playerNum, "Start", ctx));
        }
Esempio n. 14
0
 public void Thinking(IMonitorContext ctx)
 {
     Send(new Neof5Protocols.ProtocolData(playerNum, "Thinking", ctx));
 }