public Steel(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto, Gauges strength, Effects resistance, Gauges shineyness, ResourceBase additionalResource)
     : base(type, requires, buildsInto, additionalResource)
 {
     Strength   = strength;
     Resistance = resistance;
     Shineyness = shineyness;
 }
 protected CraftedResources(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto, ResourceBase additionalResource)
     : this(type, requires, buildsInto)
 {
     if (!IsValidAdditionalResource(additionalResource))
     {
         throw new InvalidOperationException("Can not match '" + additionalResource.Name + "' with '" + Name);
     }
     else
     {
         this.additionalResource = additionalResource;
     }
 }
 protected CraftedResources(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto)
 {
     if (!IsValidType(type))
     {
         throw new InvalidOperationException("The given type if crafted resource ('" + type.ToString() + "') is not valid for the casted type");
     }
     else
     {
         Type       = type;
         BuildsInto = buildsInto ?? new List <Components>();
         Requires   = requires ?? new Dictionary <ResourceTypes, int>();
     }
 }
示例#4
0
    static Effects?GetEffect(CraftedResourcesType resource)
    {
        switch (resource)
        {
        case CraftedResourcesType.S_316:
            return(Effects.Corrosion);

        case CraftedResourcesType.S_316Ti:
            return(Effects.Heat);

        case CraftedResourcesType.S_430:
            return(Effects.Cold);
        }
        return(null);
    }
    public static ResourceTypes[] GetRequirements(CraftedResourcesType type)
    {
        var requirements = new List <ResourceTypes>();

        if (type.ToString().ToLower()[0] == 's')
        {
            requirements.AddRange(new ResourceTypes[] { ResourceTypes.Iron, ResourceTypes.Magnesium, ResourceTypes.Chromite });
        }
        else if (type.ToString().ToLower()[0] == 'b')
        {
            requirements.AddRange(new ResourceTypes[] { ResourceTypes.Coal, ResourceTypes.Cobalt });
        }

        switch (type)
        {
        case CraftedResourcesType.S_316:
            requirements.Add(ResourceTypes.Molybdenum);
            break;

        case CraftedResourcesType.S_316Ti:
            requirements.Add(ResourceTypes.Titanium);
            break;

        case CraftedResourcesType.S_430:
            requirements.Add(ResourceTypes.Nickel);
            break;

        case CraftedResourcesType.S_440C:
            requirements.Add(ResourceTypes.Carbon);
            break;

        case CraftedResourcesType.B_Lithium:
            requirements.Add(ResourceTypes.Lithium);
            break;

        case CraftedResourcesType.B_Plasma:
            requirements.Add(ResourceTypes.Plasma);
            break;
        }

        return(requirements.ToArray());
    }
 protected virtual bool IsValidType(CraftedResourcesType type)
 {
     return(false);
 }
 protected override bool IsValidType(CraftedResourcesType type)
 {
     return(type.ToString().Split('_')[0] == "B");
 }
 public Battery(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto, ResourceBase additionalResource, Gauges power, bool isRechargable)
     : base(type, requires, buildsInto, additionalResource)
 {
     Power         = power;
     IsRechargable = isRechargable;
 }
示例#9
0
 public static List <EquipmentType> GetBuildsInto(CraftedResourcesType type)
 {
     return(Enum.GetNames(typeof(EquipmentType)).Select((s) => (EquipmentType)Enum.Parse(typeof(EquipmentType), s)).ToList());
 }