Example #1
0
        /// <summary>
        /// Call this to initialize a Behaviour with data supplied in a file.
        /// </summary>
        /// <param name="fileName">The file to load from.</param>
        public override void LoadContent(String fileName)
        {
            base.LoadContent(fileName);

            InventoryDefinition def = GameObjectManager.pInstance.pContentManager.Load <InventoryDefinition>(fileName);

            // Assume a starting size of the inventory.
            mObjects = new List <GameObject>(16);

            // To start the inventory is empty and so no items have been selected.
            mCurrentObject = -1;
        }
    public void Initialize(InventoryDefinition lootInventory, UnitLogic[] startingUnits, GameItemData itemData)
    {
        LootInventory    = lootInventory;
        CurrentUnits     = startingUnits.ToList();
        ItemData         = itemData;
        CurrentUnitCount = 0;

        foreach (UnitLogic unit in CurrentUnits)
        {
            unit.OnPathFinished.AddListener(OnAdventureFinish);
            unit.SetDisable();
        }

        AddNewUnit();
    }
Example #3
0
 public PlayerDefinition(
     string userId,
     string name,
     CombatStats combatStats,
     SkillStats skillStats,
     SkillResources skillResources,
     Statistics statistics,
     PlayerAppearanceDefinition appearance,
     InventoryDefinition inventory)
 {
     this.UserId         = userId;
     this.Name           = name;
     this.CombatStats    = combatStats ?? new CombatStats();
     this.SkillStats     = skillStats ?? new SkillStats();
     this.SkillResources = skillResources ?? new SkillResources();
     this.Statistics     = statistics ?? new Statistics();
     this.Appearance     = appearance;
     this.Inventory      = inventory ?? new InventoryDefinition(null, null);
 }
Example #4
0
 public InventoryExpansion(InventoryDefinition inventory, GameState currentState)
 {
     this.inventory    = inventory;
     this.currentState = currentState;
 }
Example #5
0
 public static T SetInventoryDefinition <T>(this T entity, InventoryDefinition value)
     where T : CharacterRaceDefinition
 {
     entity.SetField("inventoryDefinition", value);
     return(entity);
 }