示例#1
0
        public RewardGoldTest()
        {
            _tableSheets = new TableSheets();
            _tableSheets.SetToSheet(nameof(WorldSheet), "test");
            _tableSheets.SetToSheet(nameof(QuestSheet), "test");
            _tableSheets.SetToSheet(nameof(QuestRewardSheet), "test");
            _tableSheets.SetToSheet(nameof(QuestItemRewardSheet), "test");
            _tableSheets.SetToSheet(nameof(EquipmentItemRecipeSheet), "test");
            _tableSheets.SetToSheet(nameof(EquipmentItemSubRecipeSheet), "test");
            _tableSheets.SetToSheet(
                nameof(CharacterSheet),
                "id,_name,size_type,elemental_type,hp,atk,def,cri,hit,spd,lv_hp,lv_atk,lv_def,lv_cri,lv_hit,lv_spd,attack_range,run_speed\n100010,전사,S,0,300,20,10,10,90,70,12,0.8,0.4,0,3.6,2.8,2,3");

            var privateKey   = new PrivateKey();
            var agentAddress = privateKey.PublicKey.ToAddress();

            var avatarAddress = agentAddress.Derive("avatar");

            _avatarState = new AvatarState(avatarAddress, agentAddress, 0, _tableSheets, new GameConfigState());

            var gold = new GoldCurrencyState(new Currency("NCG", minter: null));

            _baseState = (State) new State()
                         .SetState(GoldCurrencyState.Address, gold.Serialize())
                         .SetState(Addresses.GoldDistribution, GoldDistributionTest.Fixture.Select(v => v.Serialize()).Serialize())
                         .MintAsset(GoldCurrencyState.Address, gold.Currency, 100000000000);
        }
示例#2
0
 public WeeklyArenaRewardTest()
 {
     _tableSheets = new TableSheets();
     _tableSheets.SetToSheet(nameof(WorldSheet), "test");
     _tableSheets.SetToSheet(nameof(QuestSheet), "test");
     _tableSheets.SetToSheet(nameof(QuestRewardSheet), "test");
     _tableSheets.SetToSheet(nameof(QuestItemRewardSheet), "test");
     _tableSheets.SetToSheet(nameof(EquipmentItemRecipeSheet), "test");
     _tableSheets.SetToSheet(nameof(EquipmentItemSubRecipeSheet), "test");
     _tableSheets.SetToSheet(
         nameof(CharacterSheet),
         "id,_name,size_type,elemental_type,hp,atk,def,cri,hit,spd,lv_hp,lv_atk,lv_def,lv_cri,lv_hit,lv_spd,attack_range,run_speed\n100010,전사,S,0,300,20,10,10,90,70,12,0.8,0.4,0,3.6,2.8,2,3");
 }
        public void SetToSheet()
        {
            _tableSheets.SetToSheet(nameof(WeeklyArenaRewardSheet), "id,item_id,ratio,min,max\n1,2,0.1,0,1");

            Assert.NotNull(_tableSheets.WeeklyArenaRewardSheet);

            var row    = _tableSheets.WeeklyArenaRewardSheet[1];
            var reward = row.Reward;

            Assert.Equal(1, row.Id);
            Assert.Equal(2, reward.ItemId);
            Assert.Equal(0.1m, reward.Ratio);
            Assert.Equal(0, reward.Min);
            Assert.Equal(1, reward.Max);
        }
示例#4
0
 public void Simulate(int level, int requiredLevel, bool expected)
 {
     _tableSheets.SetToSheet(nameof(WeeklyArenaRewardSheet), $"id,item_id,ratio,min,max,required_level\n1,302000,0.1,1,1,{requiredLevel}");
     var avatarState = new AvatarState(default, default, 0, _tableSheets, new GameConfigState())