Project details
I'm working towards building a calculator on a site that will take user input on the quantity of items a "crafter" wishes to build and will output the total amount of ingredients needed to build all of the items.
The items will be sorted into 6 catagories (varying dificulty of creation and quality of item) and the user will be able to put quantities into any combination of the 6. Example 1 cloth chest, 5 mail chest, 2 studded chest.
The more difficult items require rare items that I dont wish to be displayed unless an item requiring it is to be created. IE not a bunch of 0 ingredients.
Now then on the push I'd appreciate feedback towards what topics to research.
Will all this have to be in a form? To my knowledge forms are more for processing information on the server correct? Couldnt it all be processed client side from my script?
Design of classes
A class for each item that contains an array of class ingredient? Class ingredient would contain a name and quantity.
Such as this?
- Code: Select all
//Ingredient Constructor
function Ingredient(type, quantity){
this.type=type;
this.quantity=quantity;
}
//CraftItem Constructor
function CraftItem(name,type,ingredientList){
function display(){}//placeholder for function to display objects in the form
this.name=name;
this.type=type;
this.ingredientList=ingredientList;
}


