Exemple #1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            this._antSimulate    = new AntSimulate();
            this._antWorldWindow = new AntWorldWindow();

            speedComboBox.SelectedIndex = 2;
            scaleComboBox.SelectedIndex = 1;
        }
Exemple #2
0
        /// <summary>
        /// スクリーンセーバモードに設定する
        /// </summary>
        public void SetScreenSaverMode()
        {
            _antSimulate = new AntSimulate(this._antLifeSpan, this._antAddSpan, this._antmaxCount);

            int screenWidth  = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
            int screenHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
            int scale        = 2;

            this.antWorldWindow.antWorldImage.Width  = screenWidth;
            this.antWorldWindow.antWorldImage.Height = screenHeight;
            this.antWorldWindow.WindowState          = WindowState.Maximized;
            this.antWorldWindow.Topmost = true;
            this.antWorldWindow.Cursor  = Cursors.None;

            this._antSimulate.MakeAntWorld(screenWidth / scale, screenHeight / scale);
            this.antWorldWindow.antWorldImage.Source = this._antSimulate.AntWorldWb;
            this.antWorldWindow.ResizeMode           = ResizeMode.NoResize;
            this.antWorldWindow.MouseMove           += new MouseEventHandler(AntWorldWindow_MouseMove);
            this.antWorldWindow.KeyDown += AntWorldWindow_KeyDown;

            this._antSimulate.SetAntWalkInterval((int)ConstValue.AntSpeed.Normal);
        }