Onto

MenuAdventures.OntoModule
MenuAdventures.Onto

A sub-module that allows things to be on top of other things.

julia> using MenuAdventures

julia> using MenuAdventures.Testing

julia> using MenuAdventures.Onto

julia> import MenuAdventures: ever_possible

julia> @universe struct Universe <: AbstractUniverse
        end;

julia> @noun struct Room <: AbstractRoom
            already_lit::Bool = true
        end;

julia> @noun struct Person <: Noun
        end;

julia> @noun struct Thing <: Noun
        end;

julia> @noun struct Table <: Noun
        end;

julia> ever_possible(::Take, ::Reachable, ::Thing) = true;

julia> ever_possible(::PutOnto, ::Reachable, ::Table) = true;

julia> ever_possible(::GoOnto, ::Immediate, ::Table) = true;

julia> cd(joinpath(pkgdir(MenuAdventures), "test", "Onto")) do
            check_choices() do interface
                you = Person(
                    "Brandon",
                    grammatical_person = second_person,
                    indefinite_article = "",
                )
                room = Room("room")
                universe = Universe(you, interface = interface)
                universe[room, you] = Containing()
                universe[room, Table("table")] = Containing()
                universe[room, Thing("thing")] = Containing()
                universe
            end
        end
true
source