//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(); }
internal static Object PreviewNode(ContentFilter node, IMonitorContext monitor, ILogger logger) { if (node == null) { return(null); } return(node._EvaluatePreview(monitor, logger)); }
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)); }
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()), }; }
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); }
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); }
public void CardDistributed(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "CardDistributed", ctx)); }
public void Kakumei(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Kakumei", ctx)); }
public void Agari(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Agari", ctx)); }
public void Nagare(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Nagare", ctx)); }
public void CardsArePut(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "CardsArePut", ctx)); }
public void Finish(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Finish", ctx)); }
// =================================== Game Events =================================== public void Start(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Start", ctx)); }
public void Thinking(IMonitorContext ctx) { Send(new Neof5Protocols.ProtocolData(playerNum, "Thinking", ctx)); }