public HookManager(ServerEventDispatcher dispatcher, VirtualScreenManager screen) { _dispatcher = dispatcher; _screen = screen; Hook = new WindowsGlobalHook(); ClientState = screen.State; }
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; }; }
/// <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; }
protected override void Initialize() { base.Initialize(); ReloadTexture(); this.vm = this.Owner.Scene.VirtualScreenManager; }
/// <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.platform = WaveServices.Platform; this.platform.OnScreenSizeChanged += this.Platform_OnScreenSizeChanged; this.viewportScreenManager = this.Owner.Scene.VirtualScreenManager; }
public ServerEventReceiver(VirtualScreenManager screen, IDeviceOption device) { this.option = device; _hook = new WindowsGlobalHook(); _screen = screen; cts = new CancellationTokenSource(); state = screen.State; }
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; }
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>(); }
/// <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; }
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); }
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>(); }
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(); }
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(); }
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(); }
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; }
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; }
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); }
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; }
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; }
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; }
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(); }
/// <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; }
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; }
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; }
/// <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; }
/// <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; }
/// <summary> /// Resolve Dependencies /// </summary> protected override void ResolveDependencies() { base.ResolveDependencies(); this.vsm = this.Owner.Scene.VirtualScreenManager; }
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; }
protected override void Initialize() { base.Initialize(); this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager; this.randomService = WaveServices.Random; }
/// <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; }
public RemoteServer(Model.IDeviceOption option) { state = new ClientState(Environment.MachineName); _screen = new VirtualScreenManager(state); _receiver = new ServerEventReceiver(_screen, option); }
/// <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; }; }