示例#1
0
        static public void Run()
        {
            Console.WriteLine("------------Singleton------------");
            //Two way for use Singleton
            //1
            WorldCreator worldCreator = WorldCreator.Instance("Mario World");

            worldCreator.Create();
            //2
            WorldCreator.Instance("Mario World");
            WorldCreator.Instance().Create();

            //The world name don't be changed
            worldCreator = WorldCreator.Instance("Yoshi's World");
            worldCreator.Create();
        }
 //ワールドを生成する
 public void Create()
 {
     WCreator.Create(worldID.ToString());
 }