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

package woaley;

import frame.Operator;
import frame.Player;


/**
 *
 * @author Ani
 */
public class Sow extends Operator{
    private Player player;
    private Integer row;
    private Integer beginningPosition;

    public Sow(Player player, Integer row, Integer beginningPosition){
        this.player = player;
        this.beginningPosition = beginningPosition;
        this.row = row;
    }


    public Player getPlayer() {
        return player;
    }

    public Integer getRow() {
        return row;
    }

    public Integer getBeginningPosition() {
        return beginningPosition;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }

    public void setRow(Integer row) {
        this.row = row;
    }

    public void setBeginningPosition(Integer beginningPosition) {
        this.beginningPosition = beginningPosition;
    }

    @Override
    public String toString() {
        return "Player " + player.getPlayer() + " is sowing from row: " + row +
                " house: " + beginningPosition + ".";
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Sow)){
            return false;
        }
        Sow sow = (Sow) obj;

        return this.row == sow.row && this.beginningPosition == sow.beginningPosition &&
                this.player==sow.player;
    }





}
