/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logic.players;

import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.Sprite;
import logic.BricksLayerManager;
import logic.GameInfo;

/**
 *
 * @author avk
 */
public class OwnerPlayer extends AbstractPlayer {

    public OwnerPlayer(Sprite sprite, SpriteAnimator animator, GameInfo info) {
        super(sprite, animator, info);
    }

    public String getName() {
        return "You";
    }

    public boolean isReadyToMove() {
        return true;
    }

    public int move(int keyState) {
        if ((keyState & GameCanvas.LEFT_PRESSED) != 0) {
            return BricksLayerManager.MOVE_LEFT;
        } else if ((keyState & GameCanvas.RIGHT_PRESSED) != 0) {
            return BricksLayerManager.MOVE_RIGTH;
        } else if ((keyState & GameCanvas.UP_PRESSED) != 0) {
            return BricksLayerManager.MOVE_UP;
        } else if ((keyState & GameCanvas.DOWN_PRESSED) != 0) {
            return BricksLayerManager.MOVE_DOWN;
        }
        return BricksLayerManager.MOVE_NONE;
    }
}
