using System; using System.Collections.Generic; namespace MoleMole { public class BaseModule { public virtual bool OnPacket(NetPacketV1 packet) { return false; } protected void UpdateField(bool isSpecified, ref T field, T newValue, Action callback = null) { if (isSpecified) { UpdateField(ref field, newValue, callback); } } protected void UpdateField(ref T field, T newValue, Action callback = null) { T arg = field; field = newValue; if (callback != null) { callback(arg, newValue); } } protected List ConvertList(List fromList) { List list = new List(); foreach (uint from in fromList) { list.Add((int)from); } return list; } } }