actionscript-book-SpriteArranger-com-example-programmingas3-geometricshapes-GeometricShapeFactory.ax [swf] flex
package //com.example.programmingas3.geometricshapes { public class @ax-actionscript-book-SpriteArranger-com-example-programmingas3-geometricshapes-GeometricShapeFactory { public static var currentShape:actionscript_book_SpriteArranger_com_example_programmingas3_geometricshapes_IGeometricShape; public static function createShape(shapeName:String, len:Number):actionscript_book_SpriteArranger_com_example_programmingas3_geometricshapes_IGeometricShape { switch (shapeName) { case "Triangle": return new actionscript_book_SpriteArranger_com_example_programmingas3_geometricshapes_EquilateralTriangle(len); case "Square": return new actionscript_book_SpriteArranger_com_example_programmingas3_geometricshapes_Square(len); case "Circle": return new actionscript_book_SpriteArranger_com_example_programmingas3_geometricshapes_Circle(len); } return null; } public static function describeShape(shapeType:String, shapeSize:Number):String { @ax-actionscript-book-SpriteArranger-com-example-programmingas3-geometricshapes-GeometricShapeFactory.currentShape = @ax-actionscript-book-SpriteArranger-com-example-programmingas3-geometricshapes-GeometricShapeFactory.createShape(shapeType, shapeSize); return @ax-actionscript-book-SpriteArranger-com-example-programmingas3-geometricshapes-GeometricShapeFactory.currentShape.describe(); } } }
(C) Æliens 27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.