Example #1
0
        static void Main(string[] args)
        {
            Director director = Director.GetInstance();

            View cityView = new CityView();

            cityView.Init();

            Console.WriteLine("------------------------------------------------------------");
            DispatchCustomEvent("Login", "XXX登陆了");
            DispatchCustomEvent("Update", "XXX升级了");

            View userDataView = new UserDataView();

            userDataView.Init();

            Console.WriteLine("------------------------------------------------------------");
            DispatchCustomEvent("Update", "XXX升级了");
            DispatchCustomEvent("Build", "XXX建筑开始建造了");

            View resourceView = new ResourceView();

            resourceView.Init();

            Console.WriteLine("------------------------------------------------------------");
            DispatchCustomEvent("Update", "XXX升级了");
            DispatchCustomEvent("Build", "XXX建筑开始建造了");

            Console.WriteLine("------------------------------------------------------------");
            resourceView.Close();
            DispatchCustomEvent("Update", "XXX升级了");

            Console.WriteLine("------------------------------------------------------------");
            RemoveCustomEvent("Update");
            DispatchCustomEvent("Update", "XXX升级了");
        }