27 lines
544 B
C#
27 lines
544 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public class WeaponModel
|
|
{
|
|
public Weapon CurrentWeapon;
|
|
public List<Weapon> Weapons;
|
|
|
|
public event Action<WeaponModel> OnUpdate;
|
|
|
|
public WeaponModel(Weapon currentWeapon, List<Weapon> weapons)
|
|
{
|
|
CurrentWeapon = currentWeapon;
|
|
Weapons = weapons;
|
|
}
|
|
|
|
public void ShootHandler()
|
|
{
|
|
OnUpdate?.Invoke(this);
|
|
}
|
|
public void WeaponChangeHandler(Weapon weapon)
|
|
{
|
|
CurrentWeapon = weapon;
|
|
OnUpdate?.Invoke(this);
|
|
}
|
|
}
|