Esempio n. 1
0
            public void RunLoop()
            {
                while (true)
                {
                    if (!wantsToStop)
                    {
                        if (!IsInitialized)
                        {
                            Gtk.Application.Init();
                            toolsWindow = new MapEditor(game);
                            toolsWindow.Show();
                            toolsWindow.Initialize();
                            IsInitialized = true;
                        }

                        Gtk.Application.RunIteration(false);
                    }
                    else
                    {
                        if (IsInitialized)
                        {
                            Gtk.Application.Quit();
                            IsInitialized = false;
                        }
                        break;
                    }
                    //Thread.Sleep (20);
                }
            }
Esempio n. 2
0
        public void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else
            {
                Destroy(this);
            }

            toolListeners      = new List <IToolChangeListener> ();
            mirrorListeners    = new List <IMirrorChangeListener> ();
            modeListeners      = new List <IModeChangeListener> ();
            mouseMoveListeners = new List <IMouseMoveListener> ();

            //initialize the map
            map   = new TileGrid(mapSize, tileSize);
            moves = new Stack <int[]>();
        }
Esempio n. 3
0
            public void RunLoop()
            {
                while(true){
                    if(!wantsToStop){
                        if (!IsInitialized) {
                            Gtk.Application.Init ();
                            toolsWindow = new MapEditor(game);
                            toolsWindow.Show();
                            toolsWindow.Initialize ();
                            IsInitialized = true;
                        }

                        Gtk.Application.RunIteration (false);
                    }else{
                        if(IsInitialized){
                            Gtk.Application.Quit ();
                            IsInitialized = false;
                        }
                        break;
                    }
                    //Thread.Sleep (20);
                }
            }