package com.robot.room.state;

import java.util.Map.Entry;

import com.robot.ActionEvent;
import com.robot.Global;
import com.robot.data.Player;
import com.robot.data.Room;
import com.robot.state.StateBase;

/**
 * 房间等待状态
 * 
 */
public class RoomWaitState extends StateBase<Room> {

	@Override
	public void execute(Room owner, String cmd, int gid, Object param) {
		switch(cmd) {
			case ActionEvent.EVENT_START_GAME:
				for (Entry<Integer, Player> entry : owner.playerMapById.entrySet()) { 
					Player player = entry.getValue();
					player.clear();
				}
				owner.stateMachine.changeState(Global.getState(RoomStartGameState.class));
				break;
		}
		
	}

}
