<commit_before>
import luxe.Input;
import luxe.States;

typedef State2TypedArgs = {
    name : String,
    int : Int,
    game : Main
}

class State1 extends State {
	public function init( value:Int ) {
        trace("State1 inited with value : " + value);
	}

    public function leave( value:Int ) {
        trace("State 1 LEAVE with value " + value);
    }
    
    public function enter( value:Int ) {
        trace("State 1 ENTER with value " + value);
    }
}

class State2 extends State {
    public function init( data:State2TypedArgs ) {
        trace("State 2 inited with data " + data);
    }

    public function enter( data:State2TypedArgs ) {
        trace("State 2 ENTER with data " + data);
    }
    public function leave( data:State2TypedArgs ) {
        trace("State 2 LEAVE with data " + data);
    }
}

class TransientState extends State {

    public var start : Float = 0;

    public function enable( duration:Float ) {
        trace("enabled transient state, will end in " + duration + 's' );
        start = haxe.Timer.stamp();
        Luxe.time.schedule( duration, function(){
            trace(" duration complete, disabling ");
            do_disable();
        });
    }

    public function update(dt:Float) {
        trace("inside transient update : " + luxe.utils.Maths.fixed((haxe.Timer.stamp() - start),3) );
    }
    
}


class Main extends luxe.Game {

	var machine : States;

    public function ready() {

    	machine = new States();
        machine.add_state(State1, 'state1', 5 );
        machine.add_state(State2, 'state2', { name:"state2init", int:24, game:this } );
        machine.add_state(TransientState, 'transient');
<commit_msg>Tests; fixing test states for latest enabled/disable flags<commit_after>
import luxe.Input;
import luxe.States;

typedef State2TypedArgs = {
    name : String,
    int : Int,
    game : Main
}

class State1 extends State {
	public function init( value:Int ) {
        trace("State1 inited with value : " + value);
	}

    public function leave( value:Int ) {
        trace("State 1 LEAVE with value " + value);
    }
    
    public function enter( value:Int ) {
        trace("State 1 ENTER with value " + value);
    }
}

class State2 extends State {
    public function init( data:State2TypedArgs ) {
        trace("State 2 inited with data " + data);
    }

    public function enter( data:State2TypedArgs ) {
        trace("State 2 ENTER with data " + data);
    }
    public function leave( data:State2TypedArgs ) {
        trace("State 2 LEAVE with data " + data);
    }
}

class TransientState extends State {

    public var start : Float = 0;

    public function enabled( duration:Float ) {
        trace("enabled transient state, will end in " + duration + 's' );
        start = haxe.Timer.stamp();
        Luxe.time.schedule( duration, function(){
            trace(" duration complete, disabling ");
            disable();
        });
    }

    public function update(dt:Float) {
        trace("inside transient update : " + luxe.utils.Maths.fixed((haxe.Timer.stamp() - start),3) );
    }
    
}


class Main extends luxe.Game {

	var machine : States;

    public function ready() {

    	machine = new States();
        machine.add_state(State1, 'state1', 5 );
        machine.add_state(State2, 'state2', { name:"state2init", int:24, game:this } );
        machine.add_state(TransientState, 'transient');

{'fraction_non_alphanumeric': 0.11754334410813988, 'fraction_numerical': 0.012929767851895386, 'mean_word_length': 2.571878279118573, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1052469', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1006, 'n_words': 291}