Gusarich / housify

Housify is an advanced programming language and compiler specifically designed for Hypixel Housing
MIT License
3 stars 0 forks source link

Traits #31

Open Gusarich opened 3 months ago

Gusarich commented 3 months ago

Traits would be useful for large projects and libraries.

Suggested syntax:

trait MyTrait {
    player somePlayerStat: int = 123;
    global someGlobalStat: int = 123;

    handle Join {
        player.somePlayerStat = player.somePlayerStat + 1;
    }
}

house MyHouse with MyTrait {
    // this house already includes everything from MyTrait

    handle Quit {
        player.somePlayerStat = player.somePlayerStat - 1;
    }
}

However, we need to think about way to process overlapping handlers