Files @ f28757bb21cb
Branch filter:

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

jmaltzen
Refactor recipe / reaction computation into a common class. Add some file utilities for supporting Mac bundles. Add some scripts for building Mac app bundles. Add a help window that shows the missing reactions.
using System;

namespace DesertPaintLab
{
	public class Reagent
	{ 
		string name;
		bool isCatalyst = false;
        int cost = 0;
		PaintColor color;
		
		public bool IsCatalyst
		{
			get
			{
				return isCatalyst;	
			}
		}
		
		public PaintColor Color
		{
			get
			{
				return color;	
			}
		}
		
		public string Name
		{
			get
			{
				return name;	
			}
		}
		
        public Reagent(string name, int cost)
		{
			this.name = name;
            this.cost = cost;
			isCatalyst = true;
		}
		
        public Reagent(string name, byte red, byte green, byte blue, int cost)
		{
			color = new PaintColor(red, green, blue);
			this.name = name;
            this.cost = cost;
		}
		
		public override string ToString()
		{
			if (isCatalyst)
			{
				return "[" + name + ", catalyst]";
			}
			else
			{
				return "[" + name + ", " + color.ToString() + "]";
			}
		}
		
		
	}
}