예제 #1
0
    /// <summary>
    /// This method initializes necessary objects.
    /// </summary>
    public override void Initialize()
    {
        base.Initialize();

        Console.AddCommand("k_tilt", o => {
            if (o.Count == 1)
            {
                Console.WriteLine(Sensor.ElevationAngle.ToString());
            }
            else
            {
                Sensor.ElevationAngle = int.Parse(o[1]);
            }
        });
        Console.AddCommand("k_init", o =>
        {
            if (o.Count == 1)
            {
                DiscoverSensor();
            }
            else
            {
                DiscoverSensor(bool.Parse(o[1]), bool.Parse(o[2]));
            }
        });
        Console.AddCommand("k_uninit", o => Uninitialize());
        Console.AddCommand("k_video", o =>
        {
            if (o[1].ToLower() == "open")
            {
                OpenColorStream();
            }
            else if (o[1].ToLower() == "close")
            {
                ColorStream = null;
            }
        });
        Console.AddCommand("k_depth", o =>
        {
            if (o[1].ToLower() == "open")
            {
                OpenDepthStream();
            }
            else if (o[1].ToLower() == "close")
            {
                DepthStream = null;
            }
        });
        Console.AddCommand("k_status", o => Console.WriteLine(GetStatus()));
        Console.AddCommand("k_draw", o => Draw         = bool.Parse(o[1]));
        Console.AddCommand("k_seated", o => SeatedMode = bool.Parse(o[1]));
    }
예제 #2
0
파일: Neat.cs 프로젝트: ARLM-Attic/neat
        public void Create()
        {
            Ram = new RAM(this);

            videos       = new Dictionary <string, Video>();
            videoPlayers = new List <VideoPlayer>();
            sounds       = new Dictionary <string, SFXList>();
            songs        = new Dictionary <string, Song>();
            effects      = new Dictionary <string, Effect>();
            fonts        = new Dictionary <string, SpriteFont>();

            Console           = new Neat.Components.Console(this);
            TextEffects       = new Neat.Components.TextEffects(this);
            ElegantTextEngine = new Neat.Components.ElegantTextEngine(this);
            Event.Engine      = this;

            Components.Add(Console);
            Components.Add(TextEffects);
            Components.Add(ElegantTextEngine);

#if KINECT
            Components.Add(
                Kinect = new KinectEngine(this,
                                          ColorImageFormat.RgbResolution640x480Fps30,
                                          DepthImageFormat.Resolution640x480Fps30));
            Components.Add(
                Touch = new Kintouch(this, Kinect));
#endif

#if LIVE
            Components.Add(new GamerServicesComponent(this));
#endif

            Graphics              = new GraphicsDeviceManager(this);
            RandomGenerator       = new Random();
            Content.RootDirectory = "Content";

            SetFrameRate(60);

            Screens = new Dictionary <string, Screen>();
            AddScreens();
        }