private void playerAction(String action, String direction)
    {
	if (action.equals("walk"))
	{
	    // System.out.print(
	    // Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(),
	    // LocalModel.getInstance().getUnitTypeDeclaration()).getX());
	    // System.out.println( "," +
	    // Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(),
	    // LocalModel.getInstance().getUnitTypeDeclaration()).getY());
	    if (Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getTopBound() < Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY() && Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getLeftBound() < Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX() && Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getRightBound() > Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX() && Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getBottomBound() > Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY())
	    {
		switch (direction)
		{
		    case "U":
		    {
			{
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDirection("U");
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setYVel(0 - Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getSpeed());
			    break;
			}
		    }
		    case "D":
		    {
			{
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDirection("D");
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setYVel(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getSpeed());
			    break;
			}
		    }
		    case "L":
		    {
			
			{
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDirection("L");
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setXVel(0 - Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getSpeed());
			    break;
			}
		    }
		    case "R":
		    {
			{
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDirection("R");
			    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setXVel(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getSpeed());
			    break;
			}
		    }
		}
	    }
	    else
	    {
		if (Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getTopBound() >= Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY())
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setY(Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getTopBound() + 1);
		}
		if (Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getLeftBound() >= Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX())
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setX(Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getLeftBound() + 1);
		}
		if (Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getRightBound() <= Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX())
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setX(Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getRightBound() - 1);
		}
		if (Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getBottomBound() <= Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY())
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setY(Model.getInstance().getRoom(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomX(), Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getRoomY()).getBottomBound() - 1);
		}
		Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setYVel(0);
		Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setXVel(0);
		
	    }
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).walk();
	    
	    // /////////////////////////////////////////////////////////////////////////////////////////////////////
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setX(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getXVel() + Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX());
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setY(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getYVel() + Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY());
	}
	else if (action.equals("halt"))
	{
	    switch (direction)
	    {
		case "U":
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setYVel(0);
		    break;
		}
		case "D":
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setYVel(0);
		    break;
		}
		case "L":
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setXVel(0);
		    break;
		}
		case "R":
		{
		    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setXVel(0);
		    break;
		}
	    }
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).walk();
	    
	    // //////////////////////////////////////////////////////////////////////////////////////////////////
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setX(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getXVel() + Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getX());
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setY(Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getYVel() + Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).getY());
	}
	else if (action.equals("attack"))
	{
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setAttack(true);
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setPreventMovement(true);
	}
	else if (action.equals("defend"))
	{
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDefend(true);
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setPreventMovement(true);
	}
	else if (action.equals("stop_defend"))
	{
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setDefend(false);
	    Model.getInstance().findUnitByID(LocalModel.getInstance().getMyPlayerID(), LocalModel.getInstance().getUnitTypeDeclaration()).setPreventMovement(false);
	}
	
    }