示例#1
0
        public override InputAction[] GetInputOptions(ShopAgent agent)
        {
            var toReturn = new List <InputAction>();

            toReturn.AddRange(EconomySystemUtils.GetStateInput <RequestActions>());
            toReturn.AddRange(EconomySystemUtils.GetStateInput(CraftingUtils.GetCraftingResources()));
            return(toReturn.ToArray());
        }
示例#2
0
        public void Craft_CraftingUtils()
        {
            List <CraftingResources> listCraftingResources = CraftingUtils.GetCraftingResources();

            Assert.AreEqual(4, listCraftingResources.Count);
            Assert.Contains(CraftingResources.Wood, listCraftingResources);
            Assert.Contains(CraftingResources.Metal, listCraftingResources);
            Assert.Contains(CraftingResources.Gem, listCraftingResources);
            Assert.Contains(CraftingResources.DragonScale, listCraftingResources);
        }
示例#3
0
        protected override void MakeChoice(ShopAgent agent, int input)
        {
            var resources = CraftingUtils.GetCraftingResources();

            if (input < resources.Count)
            {
                var craftingResources = resources[input];
                MakeChoice(agent, craftingResources);
            }
        }
示例#4
0
        public float[] GetSenses()
        {
            var resources  = CraftingUtils.GetCraftingResources();
            var outputSize = resources.Count * TakenCraftingResourceRequest.SensorCount;
            var output     = new float[outputSize];

            for (var i = 0; i < resources.Count; i++)
            {
                var senses = TakenCraftingResourceRequest.GetSenses(_currentRequestData, resources[i]);
                for (var j = 0; j < senses.Length; j++)
                {
                    var index = i * TakenCraftingResourceRequest.SensorCount + j;
                    output[index] = senses[j];
                }
            }

            return(output);
        }
        // Start is called before the first frame update
        protected override List <CraftingResourceUi> GetItemList()
        {
            if (CraftsmanAgent)
            {
                var items     = new List <CraftingResourceUi>();
                var resources = CraftingUtils.GetCraftingResources();
                foreach (var resource in resources)
                {
                    var    inventoryNumber = CraftsmanAgent.craftingInventory.GetResourceNumber(resource);
                    Sprite iconImage       = requestShopSystem.system.requestSystem.GetIconByResource(resource);

                    var resourceUi = new CraftingResourceUi(resource, inventoryNumber, iconImage);
                    items.Add(resourceUi);
                }
                return(items);
            }
            return(null);
        }