internal void StackAndFlush(ResolveContext ctx)
 {
     Debug.Assert(ctx.Game == this);
     Debug.Assert(!m_resolveContextStack.Contains(ctx));
     Debug.Assert(m_resolveContextStack.Count == 0
                  || (m_resolveContextStack.Peek().RunningCommand != null
                      && m_resolveContextStack.Peek().RunningCommand.ExecutionPhase == Commands.CommandPhase.Preemptive));
     m_resolveContextStack.Push(ctx);
     ctx.FlushCommandQueue();
     m_resolveContextStack.Pop();
 }
 bool IsCommandRunnable(Commands.BaseCommand command)
 {
     var ctx = new ResolveContext(this);
     m_resolveContextStack.Push(ctx);
     bool ret = ctx.IsCommandRunnable(command);
     m_resolveContextStack.Pop();
     return ret;
 }
 internal void StackAndFlush(params Commands.BaseCommand[] commands)
 {
     var ctx = new ResolveContext(this);
     ctx.QueueCommands(commands);
     StackAndFlush(ctx);
 }