Files @ a4f9577554a9
Branch filter:

Location: ATITD-Tools/Desert-Paint-Lab/Reagent.cs - annotation

jmaltzen
Added tag VERSION_T8_RC4 for changeset d792b40d3ef9
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
/*
 * Copyright (c) 2015, Jason Maltzen

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
*/

using System;

namespace DesertPaintLab
{
	public class Reagent
	{ 
		string name;
        string ppName;
		bool isCatalyst = false;
        uint cost = 0;
        bool enabled = true;
        uint recipeMax = 10;
		PaintColor color;
		
		public bool IsCatalyst
		{
			get
			{
				return isCatalyst;	
			}
		}
		
		public PaintColor Color
		{
			get
			{
				return color;	
			}
		}
		
		public string Name
		{
			get
			{
				return name;	
			}
		}

        public string PracticalPaintName
        {
            get
            {
                return ppName;
            }
        }

        public bool Enabled
        {
            get
            {
                return enabled;
            }
            set
            {
                enabled = value;
            }
        }

        public uint Cost
        {
            get
            {
                return cost;
            }
            set
            {
                cost = Math.Max(1, value);
            }
        }

        public uint RecipeMax
        {
            get
            {
                return recipeMax;
            }
            set
            {
                if (!isCatalyst)
                {
                    recipeMax = Math.Max(0, value);
                }
            }
        }

        // catalyst
        public Reagent(string name, string ppName)
        {
            this.name = name;
            this.ppName = ppName;
            this.cost = 2;
            this.enabled = true;
            this.recipeMax = 1;
            this.isCatalyst = true;
        }
        
        public Reagent(string name, string ppName, byte red, byte green, byte blue)
        {
            this.color = new PaintColor(red, green, blue);
            this.name = name;
            this.ppName = ppName;
            this.cost = 1;
            this.recipeMax = 10;
            this.enabled = true;
            this.isCatalyst = false;
        }
        
		public override string ToString()
		{
			if (isCatalyst)
			{
				return "[" + name + ", catalyst]";
			}
			else
			{
				return "[" + name + ", " + color.ToString() + "]";
			}
		}
		
		
	}
}