﻿using UnityEngine;

namespace Assets.Scripts.Model {
    // Temporary class to construct non-standard actors. Later implement way to do that from Lua, see MoonSharp (http://www.moonsharp.org/).

    public static class ActorFactory {

        public static Actor NormalActor(Tile spawn) {
            ActorProperties properties = new ActorProperties("Normal", 3, Color.blue, "Sprites/Actor") {
                OnTick = (actor) => { actor.Move(); }
            };
            return new Actor(spawn, properties);
        }

        public static Actor RandomWalker(Tile spawn) {
            ActorProperties properties = new ActorProperties("RandomWalker", 1, Color.cyan, "Sprites/Actor") {
                OnTick = (actor) => {
                    Tile location = actor.Location;
                    actor.StartMovement(location.Neighbours[Random.Range(0, 6)]);
                    actor.Move();
                }
            };
            return new Actor(spawn, properties);
        }
    }
}