protected override void WriteUnversionedField(ID itemId, FieldChange change, DateTime now, bool fieldsAreEmpty) { string sql; if (!fieldsAreEmpty) { sql = "\r\nDECLARE\r\n vString {0}UnversionedFields{1}.{0}Value{1}%Type;\r\n BEGIN\r\n vString :={2}value{3};\r\nMERGE INTO {0}UnversionedFields{1} F\r\nUSING (\r\n SELECT {2}itemId{3} IId, \r\n {2}fieldId{3} FId,\r\n {2}language{3} L\r\n FROM DUAL) S\r\nON (F.{0}ItemId{1} = S.IId AND F.{0}FieldId{1} = S.FId\r\n AND (F.{0}Language{1} = S.L OR (F.{0}Language{1} IS NULL AND S.L IS NULL)))\r\nWHEN MATCHED THEN UPDATE\r\n SET F.{0}Value{1} = vString,\r\n F.{0}Updated{1} = {2}now{3}\r\nWHEN NOT MATCHED THEN INSERT\r\n (F.{0}ItemId{1}, F.{0}Language{1}, F.{0}FieldId{1}, F.{0}Value{1}, F.{0}Created{1}, F.{0}Updated{1})\r\n VALUES \r\n ({2}itemId{3}, {2}language{3}, {2}fieldId{3}, vString, {2}now{3}, {2}now{3});\r\nEND;"; } else { sql = " INSERT INTO {0}UnversionedFields{1} ( {0}ItemId{1}, {0}Language{1}, {0}FieldId{1}, {0}Value{1}, {0}Created{1}, {0}Updated{1} ) VALUES ( {2}itemId{3}, {2}language{3}, {2}fieldId{3}, {2}value{3}, {2}now{3}, {2}now{3} )"; } BigString bigString = (change.Value != string.Empty) ? new BigString(change.Value) : new BigString("__#!$No value$!#__"); base.Api.Execute(sql, new object[] { "itemId", itemId, "language", change.Language, "fieldId", change.FieldID, "value", bigString, "now", now }); }
protected void Update() { if (m_rolling.Update()) { if (m_rolling.Current > new BigDouble(1000.0)) { m_text.text = BigString.ToString(m_rolling.Current, m_precision); } else if (m_rolling.Current > new BigDouble(100.0)) { m_text.text = BigString.ToString(m_rolling.Current, 3); } else if (m_rolling.Current > new BigDouble(10.0)) { m_text.text = BigString.ToString(m_rolling.Current); } else if (m_rolling.Current > new BigDouble(0.0)) { m_text.text = BigString.ToString(m_rolling.Current, 1); } else { m_text.text = BigString.ToString(m_rolling.Current, 3); } } }
void Start() { string str = "1212123"; BigString bs = new BigString(str); bs.print(); }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <BigDouble> property = GetProperty <BigDouble>(); (from big in property.TakeUntilDestroy(this) select PersistentSingleton <LocalizationService> .Instance.Text(m_key, BigString.ToString(big))).SubscribeToText(m_text).AddTo(this); }
protected void OnEnable() { if (m_reactiveBig != null && m_resetOnEnable) { m_rolling.SetCurrent(m_reactiveBig.Value); m_text.text = BigString.ToString(m_rolling.Current, m_precision); } }
protected void Start() { m_text = GetComponent <Text>(); IReadOnlyReactiveProperty <BigDouble> property = GetProperty <BigDouble>(); (from big in property.TakeUntilDestroy(this) select BigString.ToString(big, m_precision)).SubscribeToText(m_text).AddTo(this); }
public static void Main(string[] args) { if (args.Length == 0) { Environment.Exit(0); } BigString bs = new BigString(args[0]); bs.Print(); }
public static void FlyweightPattern(string[] args) { if (args.Length == 0) { Console.WriteLine("please enter a number !"); Console.ReadLine(); System.Environment.Exit(0); } BigString bigString = new BigString(args[0]); bigString.Print(); Console.ReadLine(); }
private void GiveGoldReward() { int chunk = (PlayerData.Instance.MainChunk.Value <= PersistentSingleton <GameSettings> .Instance.DrillCoinMinimumConfig) ? PersistentSingleton <GameSettings> .Instance.DrillCoinMinimumConfig : PlayerData.Instance.MainChunk.Value; BiomeConfig biomeConfig = Singleton <EconomyHelpers> .Instance.GetBiomeConfig(chunk); BigDouble bigDouble = biomeConfig.BlockReward * PersistentSingleton <GameSettings> .Instance.DrillCoinMultiplier; Singleton <FundRunner> .Instance.AddCoins(bigDouble); Rewards.Add(new string[2] { BigString.ToString(bigDouble), "UI/BundleItems/BundleItem_Coins" }); }
private void SetupResources(CraftingRequirement req) { base.transform.DestroyChildrenImmediate(); if (req.Resources[6] > 0) { AddCard(BigString.ToString(new BigDouble(req.Resources[6])), "Relics", PlayerData.Instance.BlocksCollected[6].Value >= req.Resources[6]); } for (int i = 0; i < 6; i++) { if (req.Resources[i] > 0) { string text = BigString.ToString(new BigDouble(req.Resources[i])); BlockType blockType = (BlockType)i; AddCard(text, blockType.ToString(), PlayerData.Instance.BlocksCollected[i].Value >= req.Resources[i]); } } }
public BlockResourceRunner(BlockType type) { SceneLoader instance = SceneLoader.Instance; ReactiveProperty <long> source = PlayerData.Instance.BlocksCollected[(int)type]; CollectedAmount = (from amount in source select amount.ToString()).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); ReactiveProperty <long> source2 = PlayerData.Instance.BlocksInBackpack[(int)type]; BackpackAmount = (from amount in source2 select amount.ToString()).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); PrestigeBackpackMult = (from mult in Singleton <CumulativeBonusRunner> .Instance.BonusMult[(int)(13 + type)] select(!(mult == new BigDouble(1.0))) ? (BigString.ToString(mult) + "x") : string.Empty).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); PrestigeBackpackAmount = (from pair in source2.Pairwise() where pair.Current == 0 select pair.Previous into amount select amount.ToString()).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); }
protected void Start() { m_reactiveBig = GetProperty <BigDouble>(); m_text = GetComponent <Text>(); m_rolling.SetCurrent(m_reactiveBig.Value); m_text.text = BigString.ToString(m_rolling.Current, m_precision); (from target in m_reactiveBig where target < m_rolling.Current select target).TakeUntilDestroy(this).Subscribe(delegate(BigDouble target) { SetNow(target); }).AddTo(this); (from target in m_reactiveBig where target > m_rolling.Current select target).TakeUntilDestroy(this).Delay(TimeSpan.FromSeconds(m_delay)).Subscribe(delegate(BigDouble target) { m_rolling.SetTarget(target); }) .AddTo(this); }
protected void Start() { Text textField = GetComponent <Text>(); BigDouble[] previousHealth = new BigDouble[5] { BigDouble.ZERO, BigDouble.ZERO, BigDouble.ZERO, BigDouble.ZERO, BigDouble.ZERO }; int current = 0; (from moving in Singleton <CameraMoveRunner> .Instance.IsCameraMoving where !moving select moving).DelayFrame(1).Subscribe(delegate { for (int i = 0; i < previousHealth.Length; i++) { previousHealth[i] = Singleton <ChunkRunner> .Instance.CurrentChunkHealth.Value; } }).AddTo(this); (from _ in TickerService.MasterTicks select BigDouble.Max(BigDouble.ZERO, previousHealth[current] - Singleton <ChunkRunner> .Instance.CurrentChunkHealth.Value) * 2L).Subscribe(delegate(BigDouble dps) { textField.text = BigString.ToString(dps); previousHealth[current] = Singleton <ChunkRunner> .Instance.CurrentChunkHealth.Value; if (current == previousHealth.Length - 1) { current = 0; } else { current++; } }).AddTo(this); }
public PlayerGoalRunner(PlayerGoalConfig config) { SceneLoader instance = SceneLoader.Instance; UIIngameNotifications IngameNotifications = BindingManager.Instance.IngameNotifications; GoalConfig = config; GoalState = PlayerGoalStateFactory.GetOrCreatePlayerGoalState(config.ID); GoalAction = PlayerGoalActionFactory.Create(GoalConfig, GoalState); GoalName = new ReactiveProperty <string>(PersistentSingleton <LocalizationService> .Instance.Text("PlayerGoal.Title." + config.ID)); ClaimedStars = GoalState.ClaimedStars; GoalAction.CompletedStars.Subscribe(delegate(int val) { GoalState.CompletedStars.Value = val; }).AddTo(instance); if (GoalConfig.IsTutorialGoal) { Unlocked = (from step in PlayerData.Instance.TutorialStep select step >= GoalConfig.Index).TakeUntilDestroy(instance).ToReactiveProperty(); } else { Unlocked = (from lvl in Singleton <HeroTeamRunner> .Instance.GetOrCreateHeroRunner(0).LifetimeLevel select lvl >= GoalConfig.HeroLevelReq).TakeUntilDestroy(instance).ToReactiveProperty(); } ClaimAvailable = GoalState.CompletedStars.CombineLatest(GoalState.ClaimedStars, (int comp, int claim) => comp > claim).CombineLatest(Unlocked, (bool claimAvailable, bool unlocked) => claimAvailable && unlocked).TakeUntilDestroy(instance) .ToReactiveProperty(); GoalState.CompletedStars.Skip(1).Subscribe(delegate { IngameNotifications.InstantiatePlayerGoalNotification(this); }).AddTo(instance); CompletedStars = GoalAction.CompletedStars.TakeUntilDestroy(instance).ToReactiveProperty(); CompletedStars.Skip(1).Subscribe(delegate { if (PersistentSingleton <GameAnalytics> .Instance != null) { PersistentSingleton <GameAnalytics> .Instance.GoalCompleted.Value = this; } }).AddTo(instance); FullyCompleted = (from max in GoalAction.ProgressMax select max < BigDouble.ZERO).TakeUntilDestroy(instance).ToReactiveProperty(); (from full in FullyCompleted where full select full).Take(1).Subscribe(delegate { ReportAchievement(GoalConfig); }).AddTo(instance); Progress = GoalAction.Progress.TakeUntilDestroy(instance).ToReactiveProperty(); ProgressText = GoalAction.ProgressCurrent.CombineLatest(GoalAction.ProgressMax, (BigDouble cur, BigDouble max) => BigString.ToString(cur) + "/" + BigString.ToString(max)).TakeUntilDestroy(instance).ToReactiveProperty(); GemReward = (from stars in GoalState.ClaimedStars select Mathf.Min(stars, PersistentSingleton <Economies> .Instance.PlayerGoalRewards.Count - 1) into stars select PersistentSingleton <Economies> .Instance.PlayerGoalRewards[stars].GemReward).TakeUntilDestroy(instance).ToReactiveProperty(); }
private void CollectOneReward(RewardData reward) { switch (reward.Type) { case RewardEnum.AddChestBronze: Singleton <FundRunner> .Instance.AddNormalChests(reward.Amount.ToInt(), "drill"); Rewards.Add(new string[2] { BigString.ToString(reward.Amount), "UI/BundleItems/BundleItem_Chest_Bronze" }); break; case RewardEnum.AddChestSilver: Singleton <FundRunner> .Instance.AddSilverChests(reward.Amount.ToInt(), "drill"); Rewards.Add(new string[2] { BigString.ToString(reward.Amount), "UI/BundleItems/BundleItem_Chest_Silver" }); break; case RewardEnum.AddChestGold: Singleton <FundRunner> .Instance.AddGoldChests(reward.Amount.ToInt(), "drill"); Rewards.Add(new string[2] { BigString.ToString(reward.Amount), "UI/BundleItems/BundleItem_Chest_Gold" }); break; case RewardEnum.AddToKeys: Singleton <FundRunner> .Instance.AddKeys(reward.Amount.ToInt(), "drill"); Rewards.Add(new string[2] { BigString.ToString(reward.Amount), "UI/BundleItems/BundleItem_Keys" }); break; case RewardEnum.AddToGems: Singleton <FundRunner> .Instance.AddGems(reward.Amount.ToInt(), "drill", "rewards"); Rewards.Add(new string[2] { BigString.ToString(reward.Amount), "UI/BundleItems/BundleItem_Gems" }); break; case RewardEnum.AddToCoins: GiveGoldReward(); break; case RewardEnum.AddToResources: GiveResourceReward(); break; } }
public string[] GetRewardStringAndPrefabPath(RewardData reward, bool mainType) { string str = string.Empty; if (mainType) { str = "Main_"; } string str2 = string.Empty; string str3 = "+"; str3 = ((reward.Type != RewardEnum.AddToGems) ? (str3 + BigString.ToString(reward.Amount)) : (str3 + reward.Amount.ToInt().ToString())); switch (reward.Type) { case RewardEnum.AddBoosterDailyDoubleBoost: str2 = "Booster_DailyDouble"; str3 += "X"; break; case RewardEnum.AddBoosterDamageMultiplier: str2 = "Booster_Damage"; str3 += "X"; break; case RewardEnum.AddBoosterGoldMultiplier: str2 = "Booster_Gold"; str3 += "X"; break; case RewardEnum.AddBoosterHammerDuration: str2 = "Booster_Hammer"; str3 = BoosterCollectionRunner.FormatSecondsForBoosters(reward.Amount.ToInt()); break; case RewardEnum.AddBoosterKeyDropChance: str2 = "Booster_KeyChance"; str3 += "X"; break; case RewardEnum.AddBoosterShardMultiplier: str2 = "Booster_ShardMultiplier"; str3 += "X"; break; case RewardEnum.AddBoosterBerryDropChance: str2 = "Booster_BerryChance"; str3 += "X"; break; case RewardEnum.AddChestBronze: str2 = "Chest_Bronze"; break; case RewardEnum.AddChestGold: str2 = "Chest_Gold"; break; case RewardEnum.AddChestSilver: str2 = "Chest_Silver"; break; case RewardEnum.AddToCoins: case RewardEnum.AddToCoinsSmall: case RewardEnum.AddToCoinsMedium: case RewardEnum.AddToCoinsLarge: str2 = "Coins"; break; case RewardEnum.MultiplyCoins: str2 = "Coins"; str3 += "X"; break; case RewardEnum.AddToGems: str2 = "Gems"; break; case RewardEnum.AddToRelics: str2 = "Jelly"; break; case RewardEnum.AddToSkillAutoMine: str2 = "Tornado"; break; case RewardEnum.AddToSkillGoldfinger: str2 = "Goldfinger"; break; case RewardEnum.AddToSkillTapBoost: str2 = "Dynamite"; break; case RewardEnum.AddToSkillTeamBoost: str2 = "EnchantedCreatures"; break; case RewardEnum.AddToSkillTNT: str2 = "TNT"; break; case RewardEnum.AddToSkillRandomUnlocked: str2 = "Skill"; break; case RewardEnum.AddToGearLevel: str2 = "Gear"; break; } return(new string[2] { str3, "UI/BundleItems/" + str + "BundleItem_" + str2 }); }
public static void SlerpUITextBigText(BigDouble reward, Vector3 pos) { SlerpUIText("+" + BigString.ToString(reward), pos); }
private void SetNow(BigDouble big) { m_rolling.SetCurrent(big); m_text.text = BigString.ToString(big, m_precision); }
public ChunkRunner() { Singleton <PropertyManager> .Instance.AddRootContext(this); m_raycastMask = 1 << LayerMask.NameToLayer("Blocks"); SceneLoader instance = SceneLoader.Instance; BindingManager bind = BindingManager.Instance; ShowNotification = (from _ in BlocksClearTriggered select true).TakeUntilDestroy(instance).ToSequentialReadOnlyReactiveProperty(); BlocksAmount = (from amount in AllBlockAmount select(!(BossBlock.Value == null)) ? Mathf.Max(0, amount - 1) : amount).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); (from custom in CustomLevel where custom select custom).Subscribe(delegate { bind.CustomLevelNode.SetActive(value: true); }).AddTo(instance); (from custom in CustomLevel.Pairwise() where !custom.Current && custom.Previous select custom).Subscribe(delegate { bind.CustomLevelNode.SetActive(value: false); bind.CustomLevelFinishedNode.SetActive(value: true); }).AddTo(instance); (from custom in CustomLevel.Pairwise() where !custom.Current && !custom.Previous select custom).Subscribe(delegate { bind.CustomLevelNode.SetActive(value: false); bind.CustomLevelFinishedNode.SetActive(value: false); }).AddTo(instance); ChunkProgress = CurrentChunkHealth.CombineLatest(ChunkMaxHealth, (BigDouble curr, BigDouble max) => (curr / max).ToFloat()).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); ChunkHealthText = CurrentChunkHealth.CombineLatest(ChunkMaxHealth, (BigDouble curr, BigDouble max) => BigString.ToString(curr) + " / " + BigString.ToString(max)).TakeUntilDestroy(instance).ToReadOnlyReactiveProperty(); }