﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public abstract class BaseCharacter : MonoBehaviour
{
    // speed at which character should move
    [SerializeField]
    protected float speed = 1.0f;

    // used to make character move at faster speed when running
    [SerializeField]
    protected float runSpeedMultiplier = 2.0f;

    [SerializeField]
    protected DeathTypes deathType;

    [SerializeField]
    /// <summary>
    /// Indicates if character is non-combat (not fighting)
    /// </summary>
    protected bool nonCombatMode;

    // Indicates the attack range of the current weapon selected
    protected float attackRange;


    // used to cache the animator component attached to this character
    protected Animator animator;

    protected CharacterController characterController;

    // Start is called before the first frame update
    // TODO: Make Start protected and virtual, so that inherited classes can override and add to/replace Start logic
    protected virtual void Start()
    {
        // Get and cache the character controller component attached to the game object this script is attached to
        characterController = GetComponent<CharacterController>();

        // Get and cache the animator component of the game object this script is attached to
        animator = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {

    }

    // TODO: Create abstract IsAttacking method for inherited classes to override
    protected abstract bool IsAttacking();

    // Attack method


    // Move method
    protected void Move(Vector3 movement)
    {
        characterController.Move(movement);

        if (movement == Vector3.zero)
        {
            animator.SetBool("Idling", true);
        } else
        {
            animator.SetBool("Idling", false);
        }
    }


    // Set NonCombat method

}
