Exemple #1
0
 public static T Read <T>(string board, string id)
 {
     if (!BlackBoard.instance.isInitialCommitMade || !BlackBoard.instance.isGameStarted)
     {
         BlackBoard.Commit();
     }
     if (BlackBoard.instance.boards.Contains(board))
     {
         return(((BlackBoard.Board)BlackBoard.instance.boards[board]).Read <T>(id));
     }
     return(default(T));
 }
Exemple #2
0
    private void Update()
    {
        BlackBoard.GameStarted();

        if (this.playBack != PlayBack.None)
        {
            this.DispatchFrom(this.playBackPublishers);
            Dispatcher.deltaTime = Time.deltaTime;
        }

        if (!isThreading)
        {
            if (Dispatcher.instance.threadedPublishers != null && Dispatcher.instance.threadedPublishers.Count > 0)
            {
                isThreading      = true;
                dispatcherThread = new Thread(new ThreadStart(Dispatcher.DispatchThreaded));
                dispatcherThread.Start();
                while (!dispatcherThread.IsAlive)
                {
                    ;
                }
                Thread.Sleep(1);
            }
        }

        if (this.playBack == PlayBack.None)
        {
            Dispatcher.deltaTime = Time.deltaTime;
            BlackBoard.Commit();

            Dispatcher.DispatchThreaded();

            foreach (Publisher publisher in Dispatcher.Dispatch())
            {
            }
        }
    }