/*
 * Copyright 2015 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package org.drools.games.adventures

//import org.drools.games.adventures.Room;
//import org.drools.games.adventures.Thing;
import org.drools.games.adventures.model.*;

dialect "mvel"

/*
rule updateOnCharacterSelected salience 5  when
    SessionCharacter( $char : character, $us : session )
    Location( thing == $char, $room : target )
    ?look( $char, $things, $exits; )
then      
    str = "You are in the " + $room + "\n";
    str +="You can see " + $things + "\n";
    str +="Available exits are  " + $exits + "\n";
    str +="\n";
    
    $us.channels["output"].send( str ); 
end
 */

rule updateThings salience 5  when                            
    session : UserSession( c : character )
    things( c, things; )                                                      
then
    session.channels["things"].send( things );
end

rule updateExits salience 5  when                            
    session : UserSession( c : character )
    exits( c, exits; )                                                      
then
    session.channels["exits"].send( exits );
end

rule updateInventory salience 5  when                            
    session : UserSession( $char : character )
    inventory( $char, $things; )                                                      
then
    session.channels["inventory"].send( $things );
end

