Package net.sf.arianne.marboard.server.action.create

Source Code of net.sf.arianne.marboard.server.action.create.CreateDotAction

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);
  }
}
TOP

Related Classes of net.sf.arianne.marboard.server.action.create.CreateDotAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.