Ejemplo n.º 1
0
        public UI(ViewDB db_, Camera c_, SelectionCallback onSelect_)
        {
            db = db_;
            c  = c_;

            newSel = new Point(-1, -1);

            onSelect = onSelect_;
        }
Ejemplo n.º 2
0
        public UI(ViewDB db_, Camera c_, SelectionCallback onSelect_)
        {
            db = db_;
            c = c_;

            newSel = new Point(-1, -1);

            onSelect = onSelect_;
        }
Ejemplo n.º 3
0
 public void SetCallback(int marksExpected, SelectionCallback callback, object args, params Permission[] requiredPermissions)
 {
     SelectionArgs          = args;
     SelectionMarksExpected = marksExpected;
     SelectionMarks.Clear();
     SelectionMarkCount   = 0;
     SelectionCallback    = callback;
     SelectionPermissions = requiredPermissions;
 }
Ejemplo n.º 4
0
		public InputMachine()
		{
			this.currentState = State.idle;
			this.currentCharSet = null;
			this.currentIndex = 0;

			this.selectionCallback = null;
			this.addCharacterCallback = null;
			this.deleteCallback = null;
		}
Ejemplo n.º 5
0
        public GUI(ViewDB db_, Viewport v, SelectionCallback onSelect, EventDispatcher disp)
        {
            db = db_;
            c  = new Camera(0, 0, v);

            r  = new Renderer(db, c);
            ui = new UI(db, c, onSelect);

            disp.AddListener(r, EventType.View);
            disp.AddListener(ui, EventType.UI);
        }
Ejemplo n.º 6
0
        public GUI(ViewDB db_, Viewport v, SelectionCallback onSelect, EventDispatcher disp)
        {
            db = db_;
            c = new Camera(0, 0, v);

            r = new Renderer(db, c);
            ui = new UI(db, c, onSelect);

            disp.AddListener(r, EventType.View);
            disp.AddListener(ui, EventType.UI);
        }
Ejemplo n.º 7
0
        public static void Show(DirectoryInfo levelDir, FilterCallback filter, SelectionCallback callback)
        {
            //ListSelector ls = null;
            if (_instance == null)
            {
                _instance = ScriptableWizard.DisplayWizard <LevelPickerWizard>("Select level");
            }
            _instance._viewOnly = callback == null;
            _instance._levelDir = levelDir;
            _instance._filter   = filter;
            _instance._callback = callback;

            _instance.Refresh();

            _instance.Focus();
        }
    public static void Show( string title, dfAtlas atlas, string sprite, SelectionCallback callback )
    {
        if( atlas == null )
            throw new Exception( "No Texture Atlas was specified" );

        // Detect whether the user has deleted the textures after adding them to the Atlas
        if( atlas.Texture == null )
            throw new Exception( "The Texture Atlas does not have a texture or the texture was deleted" );

        var dialog = ScriptableWizard.DisplayWizard<dfSpriteSelectionDialog>( title );
        dialog.atlas = atlas;
        dialog.selectedSprite = sprite;
        dialog.minSize = new Vector2( 300, 200 );
        dialog.callback = callback;
        dialog.selectionShown = string.IsNullOrEmpty( sprite );
        dialog.ShowAuxWindow();
    }
Ejemplo n.º 9
0
    public static dfPrefabSelectionDialog Show( string title, Type componentType, SelectionCallback callback, PreviewCallback previewCallback, FilterCallback filterCallback = null )
    {
        var dialog = ScriptableWizard.DisplayWizard<dfPrefabSelectionDialog>( title );
        dialog.previewSize = DEFAULT_PREVIEW_SIZE;
        dialog.padding = DEFAULT_PADDING;
        dialog.componentType = componentType;
        dialog.minSize = new Vector2( 300, 200 );
        dialog.callback = callback;
        dialog.previewCallback = previewCallback;
        dialog.filterCallback = filterCallback;

        dialog.getFilteredItems();

        dialog.ShowAuxWindow();

        return dialog;
    }
Ejemplo n.º 10
0
    public static void Show(string title, dfAtlas atlas, string sprite, SelectionCallback callback)
    {
        if (atlas == null)
        {
            throw new Exception("No Texture Atlas was specified");
        }

        // Detect whether the user has deleted the textures after adding them to the Atlas
        if (atlas.Texture == null)
        {
            throw new Exception("The Texture Atlas does not have a texture or the texture was deleted");
        }

        var dialog = ScriptableWizard.DisplayWizard <dfSpriteSelectionDialog>(title);

        dialog.atlas          = atlas;
        dialog.selectedSprite = sprite;
        dialog.minSize        = new Vector2(300, 200);
        dialog.callback       = callback;
        dialog.selectionShown = string.IsNullOrEmpty(sprite);
        dialog.ShowAuxWindow();
    }
Ejemplo n.º 11
0
    public void RunAlgorithm()
    {
        CreatePopulation(_initialPopulation);

        if (_crossoverMethod == CrossoverMethod.One_point)
        {
            _crossoverCallback = OnePointCrossover;
        }
        else
        {
            _crossoverCallback = TwoPointCrossover;
        }

        switch (_selectionMethod)
        {
        case SelectionMethod.Proportional:
        {
            _selectionCallback = ProportionalSelection;
        }
        break;

        case SelectionMethod.Tournament:
        {
            _selectionCallback = TournamentSelection;
        }
        break;

        case SelectionMethod.Truncation:
        {
            _selectionCallback = TruncationSelection;
        }
        break;
        }

        _procreationIndex = new SelectionPair(0, _population.Count - 1);
        _tProcreation     = new Timer(_procreationStep * 2, true, Procreate);

        ModuleManager.Play(_tProcreation);
    }
Ejemplo n.º 12
0
    public static dfPrefabSelectionDialog Show(string title, Type componentType, SelectionCallback callback, PreviewCallback previewCallback, FilterCallback filterCallback)
    {
        if (componentType == null)
        {
            throw new Exception("Component type cannot be null");
        }

        var dialog = ScriptableWizard.DisplayWizard <dfPrefabSelectionDialog>(title);

        dialog.previewSize     = DEFAULT_PREVIEW_SIZE;
        dialog.padding         = DEFAULT_PADDING;
        dialog.componentType   = componentType;
        dialog.minSize         = new Vector2(640, 480);
        dialog.callback        = callback;
        dialog.previewCallback = previewCallback;
        dialog.filterCallback  = filterCallback;

        dialog.getFilteredItems();

        dialog.ShowAuxWindow();

        return(dialog);
    }
Ejemplo n.º 13
0
 public static dfPrefabSelectionDialog Show(string title, Type componentType, SelectionCallback callback, PreviewCallback previewCallback)
 {
     return(Show(title, componentType, callback, previewCallback, null));
 }
Ejemplo n.º 14
0
 private void Init()
 {
     Select = new CustomCommand(arg => SelectionCallback?.Invoke(this));
 }
Ejemplo n.º 15
0
		public void registerSelectionCallback(SelectionCallback cb)
		{
			this.selectionCallback = cb;
		}
Ejemplo n.º 16
0
 public static dfPrefabSelectionDialog Show( string title, Type componentType, SelectionCallback callback, PreviewCallback previewCallback )
 {
     return Show ( title, componentType, callback, previewCallback, null );
 }
Ejemplo n.º 17
0
 public void SetCallback( int marksExpected, SelectionCallback callback, object args, params Permission[] requiredPermissions ) {
     SelectionArgs = args;
     SelectionMarksExpected = marksExpected;
     SelectionMarks.Clear();
     SelectionMarkCount = 0;
     SelectionCallback = callback;
     SelectionPermissions = requiredPermissions;
 }