Onto
MenuAdventures.OntoMenuAdventures.Onto.GoOntoMenuAdventures.Onto.PutOntoMenuAdventures.Onto.Supporting
MenuAdventures.Onto — ModuleMenuAdventures.OntoA 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
trueMenuAdventures.Onto.GoOnto — TypeMenuAdventures.Onto.PutOnto — TypePutOnto()Put something from your Inventory onto something Reachable.
An Action. By default, ever_possible(::PutOnto, ::Inventory, _) = true, that is, you can always put something from your inventory onto a surface.
MenuAdventures.Onto.Supporting — Type