pub fn change_state(b: &mut Block, new_state: &'static str) {
    if b.state == new_state {
        return;
    }

    // call the currents state exit function
    match b.state {
        "LAND" => Land::exit(b),
        "CLEAR" => Clear::exit(b),
        _ => ()
    }  
        
    b.state = new_state;

    // call the currents state enter function
    match b.state {
        "HANG" => Hang::enter(b),
        "LAND" => Land::enter(b),
        "CLEAR" => Clear::enter(b),
        _ => ()
    }
}
// changes the current blocks state to a new one
changes the current blocks state to a new one
changes the current blocks state to a new one
pub fn change_state(b: &mut Block, new_state: &'static str) {
    if b.state == new_state {
        return;
    }
    // call the currents state exit function
    match b.state {
        "LAND" => Land::exit(b),
        "CLEAR" => Clear::exit(b),
        _ => ()
    }  
    b.state = new_state;
    // call the currents state enter function
    match b.state {
        "HANG" => Hang::enter(b),
        "LAND" => Land::enter(b),
        "CLEAR" => Clear::enter(b),
        _ => ()
    }
}
pub fn change_state ( b : & mut Block , new_state : & ' static str ) { if b . state == new_state { return ; } // call the currents state exit function match b . state { " " => Land :: exit ( b ) , " " => Clear :: exit ( b ) , _ => ( ) } b . state = new_state ; // call the currents state enter function match b . state { " " => Hang :: enter ( b ) , " " => Land :: enter ( b ) , " " => Clear :: enter ( b ) , _ => ( ) } }
changes the current blocks state to a new one
changes the current blocks state to a new one
b
&mut Block
new_state
&'static str
b
&mut Block
new_state
&'static str