using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Allegiance;

public class BasicWeapon : MonoBehaviour
{
    public const string PLAYER = "Player";
    public const string ENEMY = "Enemy";
    public Ownership owner;
    protected Health health;

    protected virtual void Awake() {
        health = GetComponent<Health>();
    }

    protected virtual void Update() {
        switch(owner) {
            case Ownership.PLAYER:
                this.gameObject.layer = LayerMask.NameToLayer(PLAYER);
                this.gameObject.transform.GetChild(0).gameObject.layer = LayerMask.NameToLayer(PLAYER);
                break;
            case Ownership.ENEMY:
                this.gameObject.layer = LayerMask.NameToLayer(ENEMY);
                this.gameObject.transform.GetChild(0).gameObject.layer = LayerMask.NameToLayer(ENEMY);
                break;
            default:
                this.owner = Ownership.NONE;
                break;
        }
    }
}
