package net.sf.arianne.marboard.server.action.create;
import marauroa.common.game.RPAction;
import net.sf.arianne.marboard.server.core.engine.MarboardZone;
import net.sf.arianne.marboard.server.entity.meta.User;
import net.sf.arianne.marboard.server.entity.shape.Dot;
import net.sf.arianne.marboard.server.entity.shape.Shape;
/**
* creates a new dot.
*
* @author hendrik
*/
public class CreateDotAction extends CreateAction {
/**
* creates a dot with the requested color and thickness
* at the requested point.
*
* @param user the user wanting to execute the action
* @param action the action to be executed
*/
@Override
protected void perform(User user, RPAction action) {
MarboardZone zone = user.getZone();
Shape shape = new Dot(action.getInt("color"), action.getInt("thickness"), action.getInt("x"), action.getInt("y"));
zone.add(shape);
}
}