Exemple #1
0
        public IEnumerable <Notification> GetLiveNotifications(RealmToken realm)
        {
            List <Notification> notification = _liveNotifications.Where(n => n.ValidForRealm(realm)).ToList();

            _liveNotifications.Clear();
            return(notification);
        }
Exemple #2
0
 public void RegisterCommands(RealmToken source, IEnumerable <Command> commands)
 {
     foreach (Command command in commands)
     {
         RegisterCommand(source, command);
     }
 }
Exemple #3
0
 public void RegisterCommand(RealmToken source, Command command)
 {
     command.Source = source;
     if (_interactiveModeRealms.Contains(source))
     {
         DebugConsole.WriteLine("Interactive command : " + command);
         new Thread(() => _datalock.ImmediateWrite(() => ExecuteCommand(command))).Start();
         DebugConsole.WriteLine("Interactive command done : " + command);
         return;
     }
     DebugConsole.WriteLine("Defered command : " + command);
     _commands.Enqueue(command);
 }
Exemple #4
0
 private void NewRealm(RealmToken token)
 {
     _tokens.Add(token);
     _ais.Add(new Ai(token, _world));
 }
Exemple #5
0
 public void RegisterInteractiveRealm(RealmToken token)
 {
     _interactiveModeRealms.Add(token);
 }
Exemple #6
0
 public void RegisterInteractiveRealm(RealmToken token)
 {
     _interactiveModeRealms.Add(token);
 }
Exemple #7
0
 public void RegisterCommands(RealmToken source, IEnumerable<Command> commands)
 {
     foreach (Command command in commands)
         RegisterCommand(source, command);
 }
Exemple #8
0
 public void RegisterCommand(RealmToken source, Command command)
 {
     command.Source = source;
     if (_interactiveModeRealms.Contains(source))
     {
         DebugConsole.WriteLine("Interactive command : " + command);
         new Thread(()=>_datalock.ImmediateWrite(() => ExecuteCommand(command))).Start();
         DebugConsole.WriteLine("Interactive command done : " + command);
         return;
     }
     DebugConsole.WriteLine("Defered command : "+command);
     _commands.Enqueue(command);
 }
Exemple #9
0
 public IEnumerable<Notification> GetLiveNotifications(RealmToken realm)
 {
     List<Notification> notification = _liveNotifications.Where(n=>n.ValidForRealm(realm)).ToList();
     _liveNotifications.Clear();
     return notification;
 }
Exemple #10
0
 public Ai(RealmToken realm, IWorld world)
 {
     _realm = realm;
     _world = world;
 }