public HookManager(ServerEventDispatcher dispatcher, VirtualScreenManager screen)
 {
     _dispatcher = dispatcher;
     _screen     = screen;
     Hook        = new WindowsGlobalHook();
     ClientState = screen.State;
 }
Esempio n. 2
0
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;

            this.starEntity = this.Owner.FindChild("star");

            this.starParticles = this.Owner.FindChild("starParticles");

            this.topCollider = this.Owner.FindChild("top")
                               .FindComponent <Collider2D>(isExactType: false);

            this.bottomCollider = this.Owner.FindChild("bottom")
                                  .FindComponent <Collider2D>(isExactType: false);

            this.starCollider = this.Owner.FindChild("star")
                                .FindComponent <Collider2D>(isExactType: false);

            this.scrollBehavior.OnEntityOutOfScreen += (sender, entity) =>
            {
                this.transform2D.X += REAPPEARANCE_X;
                this.transform2D.Y  = this.GetRandomY();
                this.StarAvaible    = true;
            };
        }
Esempio n. 3
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.hubPanel = EntityManager.Find <HubPanel>("HubPanel");

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform = WaveServices.Platform;
            this.platform.OnScreenSizeChanged += this.Platform_OnScreenSizeChanged;
        }
Esempio n. 5
0
        protected override void Initialize()
        {
            base.Initialize();

            ReloadTexture();

            this.vm = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 6
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.hubPanel = EntityManager.Find<HubPanel>("HubPanel");

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 7
0
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.platform = WaveServices.Platform;
            this.platform.OnScreenSizeChanged += this.Platform_OnScreenSizeChanged;
            this.viewportScreenManager         = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 8
0
 public ServerEventReceiver(VirtualScreenManager screen, IDeviceOption device)
 {
     this.option = device;
     _hook       = new WindowsGlobalHook();
     _screen     = screen;
     cts         = new CancellationTokenSource();
     state       = screen.State;
 }
Esempio n. 9
0
 public ServerEventReceiver(VirtualScreenManager screen)
 {
     _hook         = new WindowsGlobalHook();
     _screen       = screen;
     messageHandle = new EventWaitHandle(false, EventResetMode.AutoReset, null);
     messages      = new System.Collections.Concurrent.ConcurrentQueue <IMessage>();
     cts           = new CancellationTokenSource();
     state         = screen.State;
 }
Esempio n. 10
0
        protected override void Initialize()
        {
            base.Initialize();

            this.vsm = this.Owner.Scene.VirtualScreenManager;

            var explosion = this.Owner.Scene.EntityManager.Find("explosion");
            this.explosionBehavior = explosion.FindComponent<ExplosionBehavior>();
        }
Esempio n. 11
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.leftJoystick  = this.EntityManager.Find <Joystick>("leftJoystick");
            this.rightJoystick = this.EntityManager.Find <Joystick>("rightJoystick");

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 12
0
        public RemoteClient(EndPoint endPoint)
        {
            state = new ClientState(Environment.MachineName);

            _connection = new ServerConnectionManager(endPoint);
            _dispatcher = new ServerEventDispatcher(_connection);
            _screen     = new VirtualScreenManager(state);
            _hook       = new HookManager(_dispatcher, _screen);
        }
Esempio n. 13
0
        protected override void Initialize()
        {
            base.Initialize();

            this.vsm = this.Owner.Scene.VirtualScreenManager;

            var explosion = this.Owner.Scene.EntityManager.Find("explosion");

            this.explosionBehavior = explosion.FindComponent <ExplosionBehavior>();
        }
Esempio n. 14
0
        protected override void Initialize()
        {
            base.Initialize();

            this.followTransform = this.followEntity.FindComponent <Transform2D>();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform             = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += OnScreenSizeChanged;
            this.RefreshCameraLimits();
        }
Esempio n. 15
0
        protected override void Initialize()
        {
            base.Initialize();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform             = WaveServices.Platform;

            this.RefreshFollowEntity();

            this.platform.OnScreenSizeChanged += this.OnScreenSizeChanged;
            this.RefreshCameraLimits();
        }
Esempio n. 16
0
        protected override void Initialize()
        {
            base.Initialize();

            this.followTransform = this.followEntity.FindComponent<Transform2D>();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += OnScreenSizeChanged;
            this.RefreshCameraLimits();
        }
Esempio n. 17
0
        protected override void Initialize()
        {
            base.Initialize();

            this.soundManager = this.EntityManager.Find("SoundManager").FindComponent<SoundManager>();
            this.vm = this.Owner.Scene.VirtualScreenManager;

            this.input = WaveServices.Input;
            this.initPosition = this.Transform2D.Position;

            this.Collider.BeginCollision += Collider_BeginCollision;
            this.Collider.EndCollision += Collider_EndCollision;
        }
Esempio n. 18
0
        protected override void Initialize()
        {
            base.Initialize();

            this.soundManager = this.EntityManager.Find("SoundManager").FindComponent <SoundManager>();
            this.vm           = this.Owner.Scene.VirtualScreenManager;

            this.input        = WaveServices.Input;
            this.initPosition = this.Transform2D.Position;

            this.Collider.BeginCollision += Collider_BeginCollision;
            this.Collider.EndCollision   += Collider_EndCollision;
        }
Esempio n. 19
0
        protected override void Initialize()
        {
            base.Initialize();

            this.currentSpeed = this.Speed;

            this.vm = this.Owner.Scene.VirtualScreenManager;

            centerX = this.vm.RightEdge - this.vm.LeftEdge;
            centerY = this.vm.BottomEdge - this.vm.TopEdge;

            this.lbScoreEntity = this.EntityManager.Find(this.LabelScoreEntityPath);
        }
Esempio n. 20
0
        protected override void Initialize()
        {
            base.Initialize();

            this.soundManager = this.EntityManager.Find("SoundManager").FindComponent <SoundManager>();
            this.vm           = this.Owner.Scene.VirtualScreenManager;

            this.input        = WaveServices.Input;
            this.initPosition = this.Transform2D.Position;

            this.RigidBody.OnPhysic2DCollision  += OnPhysic2DCollision;
            this.RigidBody.OnPhysic2DSeparation += OnPhysic2DSeparation;
        }
Esempio n. 21
0
        protected override void Initialize()
        {
            base.Initialize();

            this.soundManager = this.EntityManager.Find("SoundManager").FindComponent<SoundManager>();
            this.vm = this.Owner.Scene.VirtualScreenManager;

            this.input = WaveServices.Input;
            this.initPosition = this.Transform2D.Position;

            this.RigidBody.OnPhysic2DCollision += OnPhysic2DCollision;
            this.RigidBody.OnPhysic2DSeparation += OnPhysic2DSeparation;
        }
Esempio n. 22
0
        protected override void Initialize()
        {
            base.Initialize();
            this.soundManager = WaveServices.GetService <SoundManager>();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;

            this.topMargin = this.transform2D.Rectangle.Height / 2;

            this.SetState(KiteStates.TakeOff);

            this.SetNewColor();
        }
        /// <summary>
        /// Initialize method
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform             = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += this.OnScreenSizeChanged;
            this.RefreshCameraLimits();

            this.camera2D = this.RenderManager.ActiveCamera2D;
            this.vsm      = camera2D.UsedVirtualScreen;
        }
Esempio n. 24
0
        static void Main(string[] args)
        {
            var connection = new ServerConnectionManager("http://localhost");
            var dispatcher = new ServerEventDispatcher(connection);
            var screen     = new VirtualScreenManager();
            var hook       = new HookManager(dispatcher, screen);

            ClientState.Logger = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Warning)).CreateLogger("OTB");
            hook.Start();

            hook.Hook.SendKeyDown(Core.Hook.Key.WinLeft);
            hook.Hook.SendKeyUp(Core.Hook.Key.WinLeft);

            hook.Stop();
            Console.ReadKey();
            Console.Read();
        }
Esempio n. 25
0
        /// <summary>
        /// Performs further custom initialization for this instance.
        /// </summary>
        /// <remarks>
        /// By default this method does nothing.
        /// </remarks>
        protected override void Initialize()
        {
            base.Initialize();

            // Start accelerometer if it is avaible
            if (this.inputManager.AccelerometerState.IsConnected)
            {
                this.inputManager.StartAccelerometer();
            }

            // Animations
            float gamePlayPosY = this.transform2D.Y;
            float initialPosY  = gamePlayPosY + 400;

            this.appearAnim = new SingleAnimation(initialPosY, gamePlayPosY, TimeSpan.FromSeconds(1.5f), EasingFunctions.Cubic);

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 26
0
        protected override void Initialize()
        {
            base.Initialize();

            if (string.IsNullOrEmpty(this.FollowEntityPath) ||
                string.IsNullOrEmpty(this.TiledMapEntityPath))
            {
                return;
            }

            this.followEntity    = this.EntityManager.Find(this.FollowEntityPath);
            this.followTransform = this.followEntity.FindComponent <Transform2D>();

            this.tiledMapEntity = this.EntityManager.Find(this.TiledMapEntityPath);
            this.tiledMap       = this.tiledMapEntity.FindComponent <WaveEngine.TiledMap.TiledMap>();

            this.viewportManager = this.Owner.Scene.VirtualScreenManager;
            this.platform        = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += OnScreenSizeChanged;
            this.needRefreshLimits             = true;
        }
Esempio n. 27
0
        protected override void Initialize()
        {
            base.Initialize();

            if (string.IsNullOrEmpty(this.FollowEntityPath)
                || string.IsNullOrEmpty(this.TiledMapEntityPath))
            {
                return;
            }

            this.followEntity = this.EntityManager.Find(this.FollowEntityPath);
            this.followTransform = this.followEntity.FindComponent<Transform2D>();

            this.tiledMapEntity = this.EntityManager.Find(this.TiledMapEntityPath);
            this.tiledMap = this.tiledMapEntity.FindComponent<WaveEngine.TiledMap.TiledMap>();

            this.viewportManager = this.Owner.Scene.VirtualScreenManager;
            this.platform = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += OnScreenSizeChanged;
            this.needRefreshLimits = true;
        }
Esempio n. 28
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.visibleBlocks = new List <RocksBlock>();
            this.avaibleBlocks = this.Owner.ChildEntities.Select(c => c.FindComponent <RocksBlock>()).ToList();

            var squid = this.EntityManager.Find("Squid");

            if (squid != null)
            {
                this.squidCollider = squid.FindComponent <Collider2D>(false);
            }

            var gamePlayEntity = this.EntityManager.Find("GamePlayManager");

            if (gamePlayEntity != null)
            {
                this.gamePlayManager = gamePlayEntity.FindComponent <GamePlayManager>();
            }

            this.vm = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 29
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.leftJoystick = this.EntityManager.Find<Joystick>("leftJoystick");
            this.rightJoystick = this.EntityManager.Find<Joystick>("rightJoystick");

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 30
0
        /// <summary>
        /// Resolve Dependencies
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.vsm = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 31
0
        protected override void Initialize()
        {
            base.Initialize();

            ReloadTexture();

            this.vm = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 32
0
        protected override void Initialize()
        {
            base.Initialize();
            this.soundManager = WaveServices.GetService<SoundManager>();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;

            this.topMargin = this.transform2D.Rectangle.Height / 2;

            this.SetState(KiteStates.TakeOff);

            this.SetNewColor();
        }
 protected override void Initialize()
 {
     base.Initialize();
     this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
 }
Esempio n. 34
0
 protected override void Initialize()
 {
     base.Initialize();
     this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
     this.randomService        = WaveServices.Random;
 }
Esempio n. 35
0
        protected override void Initialize()
        {
            base.Initialize();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 36
0
        /// <summary>
        /// Performs further custom initialization for this instance.
        /// </summary>
        /// <remarks>
        /// By default this method does nothing.
        /// </remarks>
        protected override void Initialize()
        {
            base.Initialize();

            // Start accelerometer if it is avaible
            if (this.inputManager.AccelerometerState.IsConnected)
            {
                this.inputManager.StartAccelerometer();
            }

            // Animations
            float gamePlayPosY = this.transform2D.Y;
            float initialPosY = gamePlayPosY + 400;
            this.appearAnim = new SingleAnimation(initialPosY, gamePlayPosY, TimeSpan.FromSeconds(1.5f), EasingFunctions.Cubic);

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
        }
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.visibleBlocks = new List<RocksBlock>();
            this.avaibleBlocks = this.Owner.ChildEntities.Select(c => c.FindComponent<RocksBlock>()).ToList();

            var squid = this.EntityManager.Find("Squid");
            if (squid != null)
            {
                this.squidCollider = squid.FindComponent<Collider2D>(false);
            }

            var gamePlayEntity = this.EntityManager.Find("GamePlayManager");
            if (gamePlayEntity != null)
            {
                this.gamePlayManager = gamePlayEntity.FindComponent<GamePlayManager>();
            }

            this.vm = this.Owner.Scene.VirtualScreenManager;
        }
Esempio n. 38
0
 protected override void Initialize()
 {
     base.Initialize();
     this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
     this.randomService = WaveServices.Random;
 }
Esempio n. 39
0
 public RemoteServer(Model.IDeviceOption option)
 {
     state     = new ClientState(Environment.MachineName);
     _screen   = new VirtualScreenManager(state);
     _receiver = new ServerEventReceiver(_screen, option);
 }
Esempio n. 40
0
        /// <summary>
        /// Resolve dependencies method
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.vsm = this.Owner.Scene.VirtualScreenManager;
        }
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;

            this.starEntity = this.Owner.FindChild("star");

            this.starParticles = this.Owner.FindChild("starParticles");

            this.topCollider = this.Owner.FindChild("top")
                                         .FindComponent<Collider2D>(isExactType: false);

            this.bottomCollider = this.Owner.FindChild("bottom")
                                         .FindComponent<Collider2D>(isExactType: false);

            this.starCollider = this.Owner.FindChild("star")
                                         .FindComponent<Collider2D>(isExactType: false);

            this.scrollBehavior.OnEntityOutOfScreen += (sender, entity) =>
            {
                this.transform2D.X += REAPPEARANCE_X;
                this.transform2D.Y = this.GetRandomY();
                this.StarAvaible = true;
            };
        }