Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Update StackCount #1508 #1512

Open
wants to merge 1 commit into
base: indev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion GameServerLib/GameObjects/Other/Stackable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ namespace LeagueSandbox.GameServer.GameObjects.Other
public class Stackable
{
public int MaxStacks { get; protected set; }
public int StackCount { get; protected set; }
public int StackCount
{
get => stackCount; protected set
{
if (stackCount != value)
{
OnStackCountChanged(stackCount, value);
stackCount = value;
}
}
}

private int stackCount;

public virtual bool IncrementStackCount()
{
Expand Down Expand Up @@ -37,5 +49,9 @@ public virtual void SetStacks(int newStacks)
}
StackCount = newStacks;
}

protected virtual void OnStackCountChanged(int oldStackCount, int newStackCount)
{
}
}
}