//=====Copyright 2017 Clayton Breckel=====//
package com.brekcel.RLGdx.actor

import com.brekcel.RLGdx.console.Cell

/** Base class of all Actors. (Players and NPC's) */
open class Actor(
		/** Actor's current x pos */
		var x: Int,
		/** Actor's current y pos */
		var y: Int,
		/** The cell that is drawn for the actor */
		var cell: Cell,
		/** Whether or not other actors can walk on/thru this actor */
		var solid: Boolean,
		/** How far this actor can see */
		var visLength: Short) {

	/** Where this actor is trying to walk to */
	var goalX = y
		private set

	/** Where this actor is trying to walk to */
	var goalY = x
		private set

	/** Sets the actors [goalX] and [goalY] to the given x,y coords */
	fun moveTo(x: Int, y: Int) {
		goalX = x
		goalY = y
	}

	/** Displaces the actor based on the given coords */
	fun move(x: Int, y: Int) {
		this.x += x
		this.y += y
	}

	/** Moves the actor to the given coords */
	fun teleport(x: Int, y: Int) {
		this.x = x
		this.y = y
	}

}