package org.drools.games.adventures

dialect "mvel"

// Things

declare Thing
    id : long
end   

declare Character extends Thing
    name : String @key
end  

declare Item extends Thing
    name : String @key
    fixed : boolean
end

declare Room extends Thing   
    name : String @key
end
        
declare Door extends Thing
   fromRoom : Room @key
   toRoom : Room @key
end  

declare Key extends Thing
end

declare Lock extends Thing
    key : Key @key
    door : Door @key
    status : String
end

// State
declare Location
    thing : Thing @key
    target : Thing @key
end

declare Holding
   character : Character @key
   thing : Thing @key
end

declare SessionCharacter
    session : UserSession
    character : Character
end    

// Events
declare GameEvent
   @role(event)
end

declare CharacterSelectedEvent extends GameEvent
   @role(event)
   character : Character @key
end
 
declare ExitEvent extends GameEvent
   @role(event)
   character : Character @key   
   room : Room @key
end

declare EnterEvent extends GameEvent
   @role(event)
   character : Character @key
   room : Room @key
end

declare PickupEvent extends GameEvent
   @role(event)
   character : Character @key
   thing : Thing @key
end

declare DropEvent extends GameEvent
   @role(event)
   character : Character @key
   thing : Thing @key
end

declare GiveEvent extends GameEvent
   @role(event)
   giver : Character @key
   thing : Thing @key   
   receiver : Character @key
end


// Commands
declare Command
    requestId : long
end

declare MoveCommand extends Command
   character : Character @key
   room : Room @key
end

declare DropCommand extends Command
   character : Character @key
   thing : Thing @key
end

declare GiveCommand extends Command
   giver : Character @key
   thing : Thing @key   
   receiver : Character @key
end

declare PickupCommand extends Command
   character : Character @key
   thing : Thing @key
end

declare LookCommand extends Command
   character : Character @key
end

declare SetSessionCharacterCommand extends Command
    session : UserSession  @key
    character : Character  @key
end

