Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged Added machine gun weapon & VFX Moved third party code to Plugins folder to improve compile times
This commit is contained in:
parent
2a0fe34611
commit
dbc522a224
2105 changed files with 7033 additions and 1141 deletions
|
|
@ -1,27 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Thanks, https://stackoverflow.com/a/49924960
|
||||
public sealed class SizedQueue<T> : Queue<T>
|
||||
{
|
||||
public int FixedCapacity { get; }
|
||||
|
||||
public SizedQueue(int fixedCapacity)
|
||||
{
|
||||
FixedCapacity = fixedCapacity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the total number of item exceed the capacity, the oldest ones automatically dequeues.
|
||||
/// </summary>
|
||||
/// <returns>The dequeued value, if any.</returns>
|
||||
public new T Enqueue(T item)
|
||||
{
|
||||
base.Enqueue(item);
|
||||
if (Count > FixedCapacity)
|
||||
{
|
||||
return Dequeue();
|
||||
}
|
||||
return default;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue