예제 #1
0
 public static bool SaveBot()
 {
     foreach (ControlBase control in Screen.controls.Keys)
     {
         if (control.IsLearnable)
         {
             GameControlBase CastControl = (GameControlBase)control;
             LearningBot     bot         = CastControl.GetBot();
             NetworkLoader.SaveLearningBot(NET_SAVE_NAME, bot);
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 internal static bool LoadOpponent()
 {
     foreach (ControlBase control in Game1.Screen.controls.Keys)
     {
         if (control.IsLearnable)
         {
             GameControlBase CastControl = (GameControlBase)control;
             LearningBot     bot         = NetworkLoader.LoadLearningBot(OPPONENT_SAVE_NAME);
             bot.Setup(CastControl, bot.BotTurn);
             CastControl.SetOpponent(bot);
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
 public static bool LoadBot()
 {
     foreach (ControlBase control in Screen.controls.Keys)
     {
         if (control.IsLearnable)
         {
             GameControlBase CastControl = (GameControlBase)control;
             LearningBot     bot         = NetworkLoader.LoadLearningBot(NET_SAVE_NAME);
             bot.Setup(CastControl, bot.BotTurn);
             CastControl.SetBot(bot);
             return(true);
         }
     }
     return(false);
 }
 public override void SetBot(LearningBot bot)
 {
     base.SetBot(bot);
     Restart(Mode);
 }
 /// <summary>
 /// Attach the bot to the control, after this StartLearn can be called.
 /// </summary>
 public void AttachBot(LearningBot botAttach, Players botPlayer)
 {
     bot       = botAttach;
     BotPlayer = botPlayer;
 }
예제 #6
0
 public virtual void SetBot(LearningBot bot)
 {
     this.bot = bot;
 }
예제 #7
0
 public virtual void SetOpponent(LearningBot bot)
 {
     opponent = bot;
 }
예제 #8
0
 public TelegramController(LearningBot bot, ILifetimeScope scope)
 {
     _bot   = bot;
     _scope = scope;
 }