package net.wasdev.gameon.room.engine.sample;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import net.wasdev.gameon.room.engine.DataProvider;
import net.wasdev.gameon.room.engine.Room;
import net.wasdev.gameon.room.engine.RoomCommand;
import net.wasdev.gameon.room.engine.meta.ExitDesc;
import net.wasdev.gameon.room.engine.meta.ItemDesc;
import net.wasdev.gameon.room.engine.meta.RoomDesc;
import net.wasdev.gameon.room.engine.sample.commands.Drop;
import net.wasdev.gameon.room.engine.sample.commands.Examine;
import net.wasdev.gameon.room.engine.sample.commands.Go;
import net.wasdev.gameon.room.engine.sample.commands.Help;
import net.wasdev.gameon.room.engine.sample.commands.Inventory;
import net.wasdev.gameon.room.engine.sample.commands.ListPlayers;
import net.wasdev.gameon.room.engine.sample.commands.Look;
import net.wasdev.gameon.room.engine.sample.commands.Quit;
import net.wasdev.gameon.room.engine.sample.commands.Reset;
import net.wasdev.gameon.room.engine.sample.commands.Take;
import net.wasdev.gameon.room.engine.sample.commands.Use;
import net.wasdev.gameon.room.engine.sample.items.Items;

public class SampleDataProvider implements DataProvider{

	static List<RoomCommand> globalCommands = Arrays.asList(new RoomCommand[]{
			new Go(),
			new Reset(), 
			new ListPlayers(), 
			new Look(), 
			new Inventory(), 
			new Drop(), 
			new Take(), 
			new Quit(), 
			new Use(), 
			new Examine(), 
			new Help()});
	
	ExitDesc barToBasement = new ExitDesc("Basement",ExitDesc.Direction.DOWN,"A flight of stairs leading into a dark basement");
	RoomDesc bar = new RoomDesc("RecRoom",
            "Rec Room","A dimly lit shabbily decorated room, that appears tired and dated. It looks like someone attempted to provide kitchen facilities here once, but you really wouldn't want to eat anything off those surfaces!",
            true, //is a starter location.
            new ItemDesc[] {Items.mug,Items.coffeeMachine,Items.stilettoHeels,Items.jukebox,Items.cupboard},
            new ExitDesc[]{barToBasement});
	
	ExitDesc basementToBar = new ExitDesc("RecRoom",ExitDesc.Direction.UP,"A flight of stairs leading back to the Rec Room");
	RoomDesc basement = new RoomDesc("Basement",
            "Basement","A dark basement. It is dark here. You think you should probably leave.",
            false, //is a starter location.
            new ItemDesc[] {},
            new ExitDesc[]{basementToBar});

    Collection<Room> rooms = new ArrayList<Room>(Arrays.asList(new Room[]{
    		new Room(bar,globalCommands),
    		new Room(basement,globalCommands),
    		}));
	
	@Override
	public Collection<Room> getRooms() {
		return rooms;
	}

}

@@ -1613,24 +1613,156 @@
 basement%22);%0A
+%09ExitDesc barToNode = new ExitDesc(%22TheNodeRoom%22,ExitDesc.Direction.EAST,%22A strange looking door that has dot js written on it%22);%0A%09%0A
 %09RoomDesc ba
@@ -2212,16 +2212,26 @@
 Basement
+,barToNode
 %7D);%0A%09%0A%09E

Add an exit to the node room.