コード例 #1
0
 public static bool OnPlayerStatChanged(int tag)
 {
     PlayerValueChangeEventArgs args = new PlayerValueChangeEventArgs
     {
         Tag = (PlayerChangeType) tag,
         Block = false
     };
     PlayerValueChanged?.Invoke(null, args);
     return args.Block;
 }
コード例 #2
0
        public static bool OnPlayerStatChanged(int tag)
        {
            PlayerValueChangeEventArgs args = new PlayerValueChangeEventArgs
            {
                Tag   = (PlayerChangeType)tag,
                Block = false
            };

            PlayerValueChanged?.Invoke(null, args);
            return(args.Block);
        }
コード例 #3
0
 public static void OnPlayerStatChanged(int tag)
 {
     PlayerValueChangeEventArgs args = new PlayerValueChangeEventArgs {Tag = (PlayerChangeType) tag};
     PlayerValueChanged?.Invoke(args);
 }
コード例 #4
0
        private void OnPlayerValueChanged(object sender, PlayerValueChangeEventArgs args)
        {
            if (Player.Player == null)
            {
                Debugger.WriteLine(LogLevel.Warning, "Player is NULL! Aborting!");
                return;
            }

            Debugger.WriteLine(LogLevel.Info, $"Attempting to update value {args.Tag}");
            if (Player.IsLocked(args.Tag))
            {
                Debugger.WriteLine(LogLevel.Info, "Value locked! Aborting changes...");
                args.Block = true;
                return;
            }

            if (!playerValueUpdateQueue.ContainsKey(args.Tag))
                playerValueUpdateQueue.Add(args.Tag, () => Player.UpdateField(args.Tag));
        }