public static void OnPropertyRemoved(int tag, ref Maid currentMaid, int id)
        {
            StatusChangedEventArgs args = new StatusChangedEventArgs
            {
                Tag             = (MaidChangeType)tag,
                CallerMaid      = currentMaid,
                ID              = id,
                Value           = -1,
                BlockAssignment = false
            };

            PropertyRemoved?.Invoke(null, args);
        }
        public static void OnStatusChangedCallback(int tag, ref Maid currentMaid)
        {
            StatusChangedEventArgs args = new StatusChangedEventArgs
            {
                Tag             = (MaidChangeType)tag,
                CallerMaid      = currentMaid,
                ID              = -1,
                Value           = -1,
                BlockAssignment = false
            };

            StatusChanged?.Invoke(null, args);
        }
        public static bool OnStatusChangedID(int tag, ref Maid currentMaid, int id, int val)
        {
            StatusChangedEventArgs args = new StatusChangedEventArgs
            {
                Tag             = (MaidChangeType)tag,
                CallerMaid      = currentMaid,
                ID              = id,
                Value           = val,
                BlockAssignment = false
            };

            StatusChangedID?.Invoke(null, args);
            return(args.BlockAssignment);
        }
        private void OnStatusChanged(object sender, StatusChangedEventArgs args)
        {
            Debugger.WriteLine($"Changed status for property {EnumHelper.GetName(args.Tag)}");
            MaidInfo maid = SelectedMaid;
            if (maid == null)
            {
                Debugger.WriteLine(LogLevel.Warning, "Maid is NULL!");
                return;
            }

            if (maid.Maid != args.CallerMaid)
            {
                Debugger.WriteLine(LogLevel.Warning, "Caller maid is not the selected one! Aborting...");
                return;
            }

            if (!valueUpdateQueue[currentQueue].ContainsKey(args.Tag))
                valueUpdateQueue[currentQueue].Add(args.Tag, () => maid.UpdateField(args.Tag, args.ID, args.Value));
            else
                Debugger.WriteLine(LogLevel.Warning, $"Tag already in update queue {currentQueue}! Aborting...");
        }
        private void OnPropertyHasChanged(object sender, StatusChangedEventArgs args)
        {
            MaidInfo maid = SelectedMaid;
            if (maid == null)
                return;

            if (maid.Maid != args.CallerMaid)
                return;

            if (valueUpdateQueue[currentQueue].ContainsKey(args.Tag))
            {
                Debugger.WriteLine(LogLevel.Warning, $"Tag already in update queue {currentQueue}! Aborting...");
                return;
            }
            switch (args.Tag)
            {
                case MaidChangeType.NewGetWork:
                case MaidChangeType.Work:
                    valueUpdateQueue[currentQueue].Add(args.Tag, () => maid.UpdateHasWork(args.ID));
                    break;
                case MaidChangeType.NewGetSkill:
                case MaidChangeType.Skill:
                    valueUpdateQueue[currentQueue].Add(args.Tag, () => maid.UpdateHasSkill(args.ID));
                    break;
            }
        }
 public static bool OnStatusChangedID(int tag, ref Maid currentMaid, int id, int val)
 {
     StatusChangedEventArgs args = new StatusChangedEventArgs
     {
         Tag = (MaidChangeType) tag,
         CallerMaid = currentMaid,
         ID = id,
         Value = val,
         BlockAssignment = false
     };
     StatusChangedID?.Invoke(args);
     return args.BlockAssignment;
 }
 public static void OnSkillExpAdded(ref Maid currentMaid, int id, int addval)
 {
     StatusChangedEventArgs args = new StatusChangedEventArgs
     {
         Tag = MaidChangeType.SkillExp,
         CallerMaid = currentMaid,
         ID = id,
         Value = addval
     };
     SkillExpAdded?.Invoke(args);
 }
 public static void OnPropertyRemoved(int tag, ref Maid currentMaid, int id)
 {
     StatusChangedEventArgs args = new StatusChangedEventArgs
     {
         Tag = (MaidChangeType) tag,
         CallerMaid = currentMaid,
         ID = id,
         Value = -1,
         BlockAssignment = false
     };
     PropertyRemoved?.Invoke(args);
 }
 public static void OnNewPropertyGet(int tag, ref Maid currentMaid, int id)
 {
     StatusChangedEventArgs args = new StatusChangedEventArgs
     {
         Tag = (MaidChangeType) tag,
         CallerMaid = currentMaid,
         BlockAssignment = false,
         ID = id,
         Value = -1
     };
     NewProperty?.Invoke(args);
 }
        public static void OnStatusChangedCallback(int tag, ref Maid currentMaid)
        {
            StatusChangedEventArgs args = new StatusChangedEventArgs
            {
                Tag = (MaidChangeType) tag,
                CallerMaid = currentMaid,
                ID = -1,
                Value = -1,
                BlockAssignment = false
            };

            StatusChanged?.Invoke(null, args);
        }