Exemple #1
0
        public static int SortPlayers(VariableDictionary a, VariableDictionary b)
        {
            int av = cfg.GetPartyOrderValue(a.GetValue("jobid").ToString());
            int bv = cfg.GetPartyOrderValue(b.GetValue("jobid").ToString());

            if (av < bv)
            {
                //System.Diagnostics.Debug.WriteLine(a.GetValue("name") + " (" + av + ") < " + b.GetValue("name") + " (" + bv + ")");
                return(-1);
            }
            if (av > bv)
            {
                //System.Diagnostics.Debug.WriteLine(a.GetValue("name") + " (" + av + ") > " + b.GetValue("name") + " (" + bv + ")");
                return(1);
            }
            //System.Diagnostics.Debug.WriteLine(a.GetValue("name") + " (" + av + ") -(" + a.GetValue("name").CompareTo(b.GetValue("name")) + ")- " + b.GetValue("name") + " (" + bv + ")");
            // https://github.com/paissaheavyindustries/Triggernometry/issues/9
            return(b.GetValue("id").CompareTo(a.GetValue("id")));
        }
Exemple #2
0
        public FilterFailReason PassesFilter(string zone, string evtext)
        {
            bool   ret = true;
            Folder f   = this;

            while (f != null && ret == true)
            {
                if (f.Enabled == false)
                {
                    return(FilterFailReason.NotEnabled);
                }
                if (ret == true && f._ZoneFilterEnabled == true)
                {
                    ret = f.rexz != null?f.rexz.IsMatch(zone) : false;
                }
                if (ret == true && f._EventFilterEnabled == true)
                {
                    ret = f.rexe != null?f.rexe.IsMatch(evtext) : false;
                }
                if (ret == true && f._FFXIVZoneFilterEnabled == true)
                {
                    ret = f.rexxivz != null?f.rexxivz.IsMatch(PluginBridges.BridgeFFXIV.ZoneID.ToString()) : false;
                }
                if (ret == true && f._FFXIVJobFilterEnabled == true)
                {
                    VariableDictionary vc = PluginBridges.BridgeFFXIV.GetMyself();
                    if (vc != null)
                    {
                        Int64 currentJob = 0;
                        Int64.TryParse(vc.GetValue("jobid").ToString(), out currentJob);
                        Int64 shifted = ((Int64)1) << ((int)currentJob - 1);
                        ret = ((f._FFXIVJobFilter & shifted) != 0);
                    }
                    else
                    {
                        ret = false;
                    }
                }
                f = f.Parent;
            }
            return(ret == true ? FilterFailReason.Passed : FilterFailReason.Failed);
        }