Parts

MenuAdventures.PartsModule
MenuAdventures.Parts

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

julia> using MenuAdventures

julia> using MenuAdventures.Testing

julia> using MenuAdventures.Parts

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 StickyThing <: Noun
        end;

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

julia> ever_possible(::Attach, ::Inventory, ::StickyThing) = true;

julia> cd(joinpath(pkgdir(MenuAdventures), "test", "Parts")) 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, StickyThing("sticky thing")] = Containing()
                universe
            end
        end
true
source