Exemple #1
0
        public static string WriteName(BoostData booster)
        {
            if (Check.NotNull(booster.ParentId))
            {
                return(ItemHelper.GetItem(booster.ParentId)?.Name ?? WriteDefaultName(booster));
            }

            return(WriteDefaultName(booster));
        }
    public void InitDataOnly(BoostData boostData)
    {
        this.boostData = boostData;

        var sprite = boostData.LoadSprite();

        if (sprite == null)
        {
            traceError("Cannot find boost sprite for: " + boostData.sprite);
        }

        this.icon.sprite = sprite;

        if (txtNumLeft != null)
        {
            UpdateNumLeft();
        }
    }
Exemple #3
0
        public static string WriteEntry(BoostData booster)
        {
            var info = new StringBuilder();

            info.AppendLine($"> **{WriteName(booster)}**");
            info.AppendLine($"> {WriteEffect(booster)}");

            if (booster.ExpiresOn.HasValue)
            {
                info.AppendLine(WriteExpiry(booster.ExpiresOn.Value));
            }

            if (booster.UsesLeft.HasValue)
            {
                info.AppendLine(WriteUseCounter(booster.UsesLeft.Value));
            }

            return(info.ToString());
        }
Exemple #4
0
 public void StringToDatas()
 {
     ItemBoosts      = BoostData.SplitFromString(ItemBoostDatas);
     AccessoryBoosts = BoostData.SplitFromString(AccessoryDatas);
 }
Exemple #5
0
 public static string WriteEffect(BoostData booster)
 {
     return($"{Icons.IconOf(booster.Type)} {Format.Percent(booster.Rate)}");
 }
Exemple #6
0
        private static string WriteDefaultName(BoostData booster)
        {
            string prefix = IsNegative(booster.Rate, booster.Type) ? "Inhibitor: " : "Booster: ";

            return($"{prefix}{booster.Type}");
        }
Exemple #7
0
 public static BoostType ToCurrencyType(this BoostData boostData)
 {
     return((BoostType)Enum.Parse(typeof(BoostType), boostData.Identity.Replace("boost_", ""), true));
 }
Exemple #8
0
        /// <summary>
        /// Creates the data for the specified row.
        /// </summary>
        /// <param name="Row">The row.</param>
        internal Data Create(Row Row)
        {
            Data Data;

            switch (this.Index)
            {
            case 1:
            {
                Data = new LocaleData(Row, this);
                break;
            }

            case 2:
            {
                Data = new GlobalData(Row, this);
                break;
            }

            case 3:
            {
                Data = new BillingPackageData(Row, this);
                break;
            }

            case 4:
            {
                Data = new AchievementData(Row, this);
                break;
            }

            case 5:
            {
                Data = new Data(Row, this);
                break;
            }

            case 6:
            {
                Data = new SoundData(Row, this);
                break;
            }

            case 7:
            {
                Data = new EffectData(Row, this);
                break;
            }

            case 8:
            {
                Data = new ParticleEmitterData(Row, this);
                break;
            }

            case 9:
            {
                Data = new ResourceData(Row, this);
                break;
            }

            case 10:
            {
                Data = new PuzzleData(Row, this);
                break;
            }

            case 11:
            {
                Data = new BlockData(Row, this);
                break;
            }

            case 12:
            {
                Data = new MonsterData(Row, this);
                break;
            }

            case 14:
            {
                Data = new LevelData(Row, this);
                break;
            }

            case 15:
            {
                Data = new TutorialData(Row, this);
                break;
            }

            case 16:
            {
                Data = new HeroData(Row, this);
                break;
            }

            case 17:
            {
                Data = new BoostData(Row, this);
                break;
            }

            case 18:
            {
                Data = new AttackTypeData(Row, this);
                break;
            }

            case 19:
            {
                Data = new SpecialMoveData(Row, this);
                break;
            }

            case 20:
            {
                Data = new PlaylistData(Row, this);
                break;
            }

            case 21:
            {
                Data = new ProjectileData(Row, this);
                break;
            }

            case 22:
            {
                Data = new MatchPatternData(Row, this);
                break;
            }

            case 23:
            {
                Data = new FacebookErrorData(Row, this);
                break;
            }

            case 24:
            {
                Data = new GateData(Row, this);
                break;
            }

            default:
            {
                Data = new Data(Row, this);
                break;
            }
            }

            return(Data);
        }