示例#1
0
        static void Main(string[] args)
        {
            IProgramVisualizer rg = new ProgramVisualizer();

            var t = rg.StartAsync();

            /*
             * rg.AddMachine("server");
             * rg.AddState("server", "Init");
             * rg.AddState("server", "Playing");
             *
             * rg.AddMachine("client");
             * rg.AddState("client", "Init");
             * rg.AddState("client", "Playing");
             */

            rg.AddTransition("server", "Init", "goto", "server", "Playing");
            rg.AddTransition("server", "Playing", "Pong", "client", "Playing");

            rg.AddTransition("client", "Init", "goto", "client", "Playing");
            rg.AddTransition("client", "Playing", "Ping", "server", "Playing");

            rg.Refresh();

            t.Wait();
        }
示例#2
0
        static void Main(string[] args)
        {
            IProgramVisualizer rg = new ProgramVisualizer();

            var t = rg.StartAsync();

            /*
            rg.AddMachine("server");
            rg.AddState("server", "Init");
            rg.AddState("server", "Playing");

            rg.AddMachine("client");
            rg.AddState("client", "Init");
            rg.AddState("client", "Playing");
            */

            rg.AddTransition("server", "Init", "goto", "server", "Playing");
            rg.AddTransition("server", "Playing", "Pong", "client", "Playing");

            rg.AddTransition("client", "Init", "goto", "client", "Playing");
            rg.AddTransition("client", "Playing", "Ping", "server", "Playing");

            rg.Refresh();

            t.Wait();
        }