Esempio n. 1
0
        public Block(EntityID in_id, string in_name, BiomeMask in_addsToBiome = BiomeMask.None,
                     GatheringTools in_gatherTool    = GatheringTools.None,
                     GatheringEffect in_gatherEffect = GatheringEffect.None,
                     EntityID?in_itemID  = null, EntityID?in_collectibleID = null,
                     bool in_isFlammable = false, bool in_isLiquid         = false,
                     int in_maxToughness = DefaultMaxToughness)
            : base(Bounds, in_id, in_name, in_addsToBiome)
        {
            var nonNullCollectibleID = in_collectibleID ?? EntityID.None;

            if (!nonNullCollectibleID.IsValidForRange(AssemblyInfo.CollectibleIDs))
            {
                throw new ArgumentOutOfRangeException(nameof(in_collectibleID));
            }
            var nonNullItemID = in_itemID ?? EntityID.None;

            if (!nonNullItemID.IsValidForRange(AssemblyInfo.ItemIDs))
            {
                throw new ArgumentOutOfRangeException(nameof(in_itemID));
            }

            GatherTool    = in_gatherTool;
            GatherEffect  = in_gatherEffect;
            ItemID        = nonNullItemID;
            CollectibleID = nonNullCollectibleID;
            IsFlammable   = in_isFlammable;
            IsLiquid      = in_isLiquid;
            MaxToughness  = in_maxToughness;
        }
Esempio n. 2
0
        public Block(GameObjectID in_id, string in_name, string in_description, string in_comment,
                     GameObjectID?in_itemID          = null, GameObjectTag?in_addsToBiome = null,
                     GameObjectTag?in_addsToRoom     = null,
                     GatheringTools in_gatherTool    = GatheringTools.None,
                     GatheringEffect in_gatherEffect = GatheringEffect.None,
                     GameObjectID?in_collectibleID   = null, bool in_isFlammable = false,
                     bool in_isLiquid = false, int in_maxToughness               = DefaultMaxToughness)
            : base(Bounds, in_id, in_name, in_description, in_comment, in_itemID ?? GameObjectID.None,
                   in_addsToBiome ?? GameObjectTag.None, in_addsToRoom ?? GameObjectTag.None)
        {
            var nonNullCollectibleID = in_collectibleID ?? GameObjectID.None;

            Precondition.IsInRange(nonNullCollectibleID, All.CollectibleIDs, nameof(in_collectibleID));

            GatherTool    = in_gatherTool;
            GatherEffect  = in_gatherEffect;
            CollectibleID = nonNullCollectibleID;
            IsFlammable   = in_isFlammable;
            IsLiquid      = in_isLiquid;
            MaxToughness  = in_maxToughness;
        }
Esempio n. 3
0
    public bool IsHarvester(Actor _unit)
    {
        List <Tool> my_harvesting_tools = _unit.Stats.Tools.Where(tool => GatheringTools.Contains(tool)).ToList();

        return(my_harvesting_tools.Count > 0);
    }
Esempio n. 4
0
    public bool IsArtisan(Actor _unit)
    {
        List <Tool> my_crafting_tools = _unit.Stats.Tools.Where(tool => !GatheringTools.Contains(tool)).ToList();

        return(my_crafting_tools.Count > 0);
    }