/// Action generator /// @todo Implement lookup table or a design pattern for easier/automatic function generation public void actionGenerator(List <GameObject[]> combinations) { iThinkAction action; //printEverything(combinations); foreach (GameObject[] matrix in combinations) { switch (schemaElements[0]) { case "get": action = new Get("Get", matrix[0], matrix[1]); tempActionList.Add(action); break; case "buy": action = new Buy("Buy", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "store": action = new Store("Store", matrix[0], matrix[1]); tempActionList.Add(action); break; case "hunt": action = new Hunt("Hunt", matrix[0], matrix[1], matrix[2], matrix[3]); tempActionList.Add(action); break; case "make": action = new Make("Make", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "harvest": action = new Harvest("Harvest", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "produce": action = new Produce("Produce", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSpell": action = new CraftSpell("CraftSpell", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSimpleWeapon": action = new CraftSimpleWeapon("CraftSimpleWeapon", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; } } }
/// Action generator /// @todo Implement lookup table or a design pattern for easier/automatic function generation public void actionGenerator( List<GameObject[]> combinations ) { iThinkAction action; //printEverything(combinations); foreach ( GameObject[] matrix in combinations ) { switch ( schemaElements[0] ) { case "get" : action = new Get( "Get", matrix[0], matrix[1] ); tempActionList.Add(action); break; case "buy" : action = new Buy( "Buy", matrix[0], matrix[1], matrix[2] ); tempActionList.Add(action); break; case "store" : action = new Store( "Store", matrix[0], matrix[1]); tempActionList.Add(action); break; case "hunt" : action = new Hunt( "Hunt", matrix[0], matrix[1], matrix[2], matrix[3]); tempActionList.Add(action); break; case "make" : action = new Make( "Make", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "harvest" : action = new Harvest( "Harvest", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "produce" : action = new Produce( "Produce", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSpell" : action = new CraftSpell ("CraftSpell", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSimpleWeapon" : action = new CraftSimpleWeapon("CraftSimpleWeapon", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; } } }