Exemplo n.º 1
0
 public BrainBase(IRobot robot, IStand stand)
 {
     Robot          = robot;
     Stand          = stand;
     IsRobotLoaded  = false;
     TargetLocation = Robot.Environment.GetObjectsCoordinatesOnTheMap()["Counter"];
     robot.OnTick  += Robot_OnTick;
 }
Exemplo n.º 2
0
        private void OnStand(string name)
        {
            IStand stand = StandFactory(name);

            if (stand == null)
            {
                return;
            }

            stand.StandRemoved += () =>
            {
                StandsOpened.Remove(stand);
                SaveStandsOpened();
            };
            stand.StandChanged += SaveStandsOpened;

            StandsOpened.Add(stand);

            SaveStandsOpened();

            OnSync();
        }
Exemplo n.º 3
0
        public void LoadStands()
        {
            StandList.Clear();

            if (Directory.Exists("Resources"))
            {
                foreach (string standFile in Directory.EnumerateFiles("Resources", "*.gif"))
                {
                    StandList.Add(Path.GetFileNameWithoutExtension(standFile));
                }
            }

            StandsOpened.Clear();
            Option.Load(OptionFile);

            foreach (StandData data in Option.Stands)
            {
                IStand stand = StandFactory(data.Name);
                if (stand == null)
                {
                    continue;
                }

                stand.StandX        = data.X;
                stand.StandY        = data.Y;
                stand.StandTopmost  = data.Topmost;
                stand.StandRemoved += () =>
                {
                    StandsOpened.Remove(stand);
                    SaveStandsOpened();
                };
                stand.StandChanged += SaveStandsOpened;

                StandsOpened.Add(stand);
            }

            OnSync();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Camera"/> class.
 /// </summary>
 /// <param name="stand">The stand which contains the view matrix.</param>
 /// <param name="lense">The lense which contains the projection matrix.</param>
 public Camera(IStand stand, ILense lense)
 {
     Stand = stand;
     Lense = lense;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Camera"/> class.
 /// </summary>
 /// <param name="stand">The stand which contains the view matrix.</param>
 /// <param name="lens">The lens which contains the projection matrix.</param>
 public Camera(IStand stand, ILens lens)
 {
     Stand = stand;
     Lens = lens;
 }