Example #1
0
        public bool HasBlock(int id, int count, bool isBuildersClub, bool isAdministrator)
        {
            var pack = BlockServices.GetPackageInternal(id);

            if (pack == null)
            {
                return(true);
            }

            //if (pack.BlocksPerPack > 0)
            //{
            //    int owned;
            //    this._itemCounts.TryGetValue(pack.Package, out owned);
            //    return (isBuildersClub && pack.Package != "brickdiamond") ||
            //           pack.BlocksPerPack * owned > count;
            //}

            switch (pack.Package)
            {
            case "admin":
                return(isAdministrator);

            case "bc":
                return(isBuildersClub);

            case "brickdiamond":
            case "brickhwthrophy":
            case "brickmagic":
            case "brickmagic2":
            case "brickmagic3":
            case "brickmagic4":
            case "brickmagic5":
check:
                return(this._itemCounts.ContainsKey(pack.Package));

            default:
                if (isBuildersClub)
                {
                    return(true);
                }
                goto check;
            }
        }
Example #2
0
        public static ForegroundType GetForegroundType(Foreground.Id id)
        {
            var package = BlockServices.GetPackageInternal((int)id);

            return(package != null ? package.ForegroundType : ForegroundType.Normal);
        }