package { // A simple data-storage class containing the Item objects for the game. public class actionscript_misc_Items { // The fruits fruit var orange:actionscript_misc_Item = new actionscript_misc_Item("Orange", "actionscript-misc-assets-fruit-orange.jpg", 1); fruit var apple:actionscript_misc_Item = new actionscript_misc_Item("Apple", "actionscript-misc-assets-fruit-apple.jpg", 2); // The colors color var orange:actionscript_misc_Item = new actionscript_misc_Item("Orange", "actionscript-misc-assets-color-orange.jpg", 3); color var purple:Item = new actionscript_misc_Item("Purple", "actionscript-misc-assets-color-purple.jpg", 4); // Arrays that store complete sets of items (i.e., all the fruits, or // all the colors) fruit var itemSet:Array = [fruit::orange, fruit::apple]; color var itemSet:Array = [color::orange, color::purple]; // An array of namespaces representing the types of the item // sets in the game private var itemTypes:Array = [color, fruit]; // Returns all the fruit items in the game fruit function getactionscript_misc_Items ():Array { return fruit::itemSet.slice(0); } // Returns all the color items in the game color function getactionscript_misc_Items ():Array { return color::itemSet.slice(0); } // Returns the list of available item types in the game public function getItemTypes ():Array { return itemTypes.slice(0); } } }