示例#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;
 }