It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Have project details just need direction

Have project details just need direction

Postby maghappy on Tue Aug 04, 2009 1:22 pm

Hello, I have some OOP background but I'm extremely new to javascript. I would greatly appreciate a helpful nudge towards the proper topics to research on the following project.

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;
}

maghappy
 
Posts: 1
Joined: Tue Aug 04, 2009 1:01 pm

Who is online

Users browsing this forum: No registered users and 4 guests