首页 > 代码库 > 原型模式prototype

原型模式prototype

使用原型实例指定创建对象的种类,然后通过拷贝这些原型来创建新的对象。

abstract  

 

public class GameSystem

{

 public static void Run(NormalActor nana,FlyActor fafa,WaterActor wawa)

{

 NormalActor na = new NormalActor1();

  NormalActor na1 = new NormalActor2();

 NormalActor na2 = new NormalActor3();

FlyActor fa = new FlyActor1();

FlyActor fa1 = new FlyActor2();

WaterActor wa = new WaterActor1();

WaterActor wa1 = new WaterActor2();

}

}