예제 #1
0
 public void UpdateV2()
 {
     Address avatarAddress = new PrivateKey().ToAddress();
     Address agentAddress  = new PrivateKey().ToAddress();
     var     avatarState   = GetNewAvatarState(avatarAddress, agentAddress);
     var     result        = new CombinationConsumable.ResultModel()
     {
         id          = default,
예제 #2
0
        public SellCancellation2Test(ITestOutputHelper outputHelper)
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Verbose()
                         .WriteTo.TestOutput(outputHelper)
                         .CreateLogger();

            _initialState = new State();
            var sheets = TableSheetsImporter.ImportSheets();

            foreach (var(key, value) in sheets)
            {
                _initialState = _initialState
                                .SetState(Addresses.TableSheet.Derive(key), value.Serialize());
            }

            var tableSheets = new TableSheets(sheets);

            var currency          = new Currency("NCG", 2, minters: null);
            var goldCurrencyState = new GoldCurrencyState(currency);

            _agentAddress = new PrivateKey().ToAddress();
            var agentState = new AgentState(_agentAddress);

            _avatarAddress = new PrivateKey().ToAddress();
            var rankingMapAddress = new PrivateKey().ToAddress();
            var avatarState       = new AvatarState(
                _avatarAddress,
                _agentAddress,
                0,
                tableSheets.GetAvatarSheets(),
                new GameConfigState(),
                rankingMapAddress)
            {
                worldInformation = new WorldInformation(
                    0,
                    tableSheets.WorldSheet,
                    GameConfig.RequireClearedStageLevel.ActionsInShop),
            };

            agentState.avatarAddresses[0] = _avatarAddress;

            var equipment = ItemFactory.CreateItemUsable(
                tableSheets.EquipmentItemSheet.First,
                Guid.NewGuid(),
                0);
            var shopState = new ShopState();

            shopState.Register(new ShopItem(
                                   _agentAddress,
                                   _avatarAddress,
                                   Guid.NewGuid(),
                                   new FungibleAssetValue(goldCurrencyState.Currency, 100, 0),
                                   equipment));

            var result = new CombinationConsumable.ResultModel()
            {
                id          = default,