using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
namespace FinTOKMAK.WeaponSystem.Runtime
{
///
/// The serializable dictionary that stores all the mount point that can mount weapon instance.
///
[System.Serializable]
public class WeaponMountPointDict : SerializableDictionary
{
}
///
/// All the state current WeaponManager is in.
///
public enum WeaponManagerState
{
///
/// There's no weapon in hand.
///
Empty,
///
/// The manager is putting out weapon.
///
PuttingOut,
///
/// The manager is putting in weapon.
///
PuttingIn,
///
/// The manager is ready to fire.
///
Ready
}
///
/// The interface of WeaponManager
///
public interface IWeaponManager where WeaponType : IWeapon
{
#region Events
///
/// The Action event triggered when the WeaponManager start initialization.
///
Action onInitialize { get; }
///
/// The Action event triggered when the WeaponManager finish initialization.
///
Action onFinishInitialize { get; }
#endregion
IRemoteWeaponAgent weaponAgent { get; }
///
/// If the WeaponManager has local authority.
///
bool isLocal { get; set; }
///
/// The dictionary that stores all the mount points that can mount weapon instance.
///
WeaponMountPointDict weaponMountPoint { get; }
///
/// All the weapon current manager is carrying.
///
List carryWeapons { get; }
///
/// The currently using weapon.
///
WeaponType currWeapon { get; }
///
/// The index of current Weapon.
///
int currIndex { get; }
///
/// The current state of WeaponManager
///
WeaponManagerState state { get; }
///
/// If the weapon is currently able to shoot;
///
bool able2Shoot { get; set; }
///
/// If the weapon is currently able to aim.
///
bool able2Aim { get; set; }
///
/// If the weapon is currently able to reload.
///
bool able2Reload { get; set; }
///
/// The action event to put out a weapon.
///
Action putOutWeaponEvent { get; set; }
///
/// The action event to async put out a weapon.
///
Action asyncPutOutWeaponEvent { get; set; }
///
/// The action event to put in a weapon.
///
Action putInWeaponEvent { get; set; }
///
/// The action event to async put in a weapon.
///
Action asyncPutInWeaponEvent { get; set; }
///
/// Add a new weapon to the last of carry weapon list.
///
/// The IWeapon instance to add.
void AddWeapon(WeaponType weapon);
///
/// Add a new weapon to the carry weapon list.
///
/// The IWeapon instance to add.
/// The index to add the new weapon.
void AddWeapon(WeaponType weapon, int index);
///
/// Remove a exist weapon from the carry weapon list.
///
/// The index of the weapon to remove.
/// The removed IWeapon instance.
WeaponType RemoveWeapon(int index);
///
/// Remove a exist weapon from the carry weapon list.
///
/// The id of the weapon to remove.
/// The removed IWeapon instance.
WeaponType RemoveWeapon(string id);
///
/// Put out a weapon using the weapon index in the carryWeapon list.
/// When there's no weapon in the hand, the WeaponManager will put out weapon directly.
/// When there's already a weapon in hand, the WeaponManager will put in current using weapon first,
/// then put out the target weapon.
///
/// the index of the weapon in the caryWeapons list, start from 0.
void PutOut(int index);
///
/// Put out a weapon using the weapon unique string id.
/// When there's no weapon in the hand, the WeaponManager will put out weapon directly.
/// When there's already a weapon in hand, the WeaponManager will put in current using weapon first,
/// then put out the target weapon.
///
/// the unique string id of the weapon
void PutOut(string id);
///
/// Put out a weapon using the weapon object.
/// When there's no weapon in the hand, the WeaponManager will put out weapon directly.
/// When there's already a weapon in hand, the WeaponManager will put in current using weapon first,
/// then put out the target weapon.
///
/// the weapon to put out.
void PutOut(WeaponType weapon);
///
/// The async version of method
///
/// the index of the weapon in the caryWeapons list, start from 0.
/// Async Task
Task PutOutAsync(int index);
///
/// The async version of method
///
/// the unique string id of the weapon
/// Async Task
Task PutOutAsync(string id);
///
/// The async version of method
///
/// the weapon to put out.
/// Async Task
Task PutOutAsync(WeaponType weapon);
///
/// Put in the current weapon.
///
void PutIn();
///
/// The async version of method
///
/// Async Task
Task PutInAsync();
///
/// The method to pull trigger down.
///
void TriggerDown();
///
/// The method to release the trigger.
///
void TriggerUp();
///
/// The method called to press down the reload key.
/// Often start the reload process.
///
void ReloadDown();
///
/// The method to release the reload key.
///
void ReloadUp();
///
/// The method to start aiming the current weapon.
///
void AimDown();
///
/// The method to stop aiming the current weapon.
///
void AimUp();
}
}