Exemplo n.º 1
0
        public static void SetupServerDb(DB_TestingHelper dbTestingHelper, Autofac.IContainer autofacContainer)
        {
//server sql dist
            TI.trace("Remove all tables from Server distributr");
            dbTestingHelper.RemoveAllServerTables();
            IInsertTestData td = autofacContainer.Resolve<IInsertTestData>();
            CokeDataContext ctxServer = autofacContainer.Resolve<CokeDataContext>();
            TI.trace("Run scripts and add data to server");
            dbTestingHelper.SetupServerSql(true, ctxServer, td);
        }
Exemplo n.º 2
0
        public SpellMacroPage()
        {
            InitializeComponent();

            ViewModel = Autofac.Resolve <SpellMacroViewModel>();
            ViewModel.Prepare();
            ViewModel.Initialize().SafeFireAndForget();

            var applicationView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
        }
Exemplo n.º 3
0
 public UbiquitiPollerHostedService(ILifetimeScope autofac) : base(autofac)
 {
     _ubiProvider = Autofac.Resolve <UbiquitiStatsProvider>();
 }
Exemplo n.º 4
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            if (force || !initialized)
            {
                var world = engineRegistrations.Resolve<PhysicsManager>().World;
                Physics = BodyFactory.CreateBody(world, Position, this);

                float spriteWidthMeters = PhysicsConstants.PixelsToMeters(Width);
                float spriteHeightMeters = PhysicsConstants.PixelsToMeters(Height);

                var rect = FixtureFactory.AttachRectangle(
                    spriteWidthMeters,
                    spriteHeightMeters,
                    1.4f,
                    Vector2.Zero,
                    Physics);

                var sensorHeight = Math.Min(spriteHeightMeters / 8, PhysicsConstants.PixelsToMeters(10));

                var detachSensor = FixtureFactory.AttachRectangle(
                    spriteWidthMeters,
                    sensorHeight,
                    1,
                    new Vector2(0, spriteHeightMeters / 2),
                    Physics);

                detachSensor.UserData = "detach";

                detachSensor.IsSensor = true;

                detachSensor.RegisterOnCollidedListener<UserControlledCharacter>(OnCollidedWithDetachSensor);

                Physics.Friction = .2f;
                Physics.FixedRotation = true;
                Physics.BodyType = BodyType.Static;
                Physics.UserData = this;

                //TODO -- Figure out Steve's collison logic for passable collision detection

                // Possible logic for passthrough collision detection
                Physics.IsSensor = true;

                Physics.RegisterOnCollidedListener<UserControlledCharacter>(OnCollidedWith);
                Physics.RegisterOnSeparatedListener<UserControlledCharacter>(OnSeparation);
                Physics.RegisterOnCollidedListener<Entity>(OnCollidedWith);

                initialized = true;
            }

            base.InitializePhysics(false, engineRegistrations);
        }
Exemplo n.º 5
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            if (!initialized || force)
            {
                var world = engineRegistrations.Resolve<PhysicsManager>().World;

                float spriteWidthMeters = PhysicsConstants.PixelsToMeters(Width);
                float spriteHeightMeters = PhysicsConstants.PixelsToMeters(Height);

                Physics = BodyFactory.CreateRectangle(
                          world,
                          spriteWidthMeters, spriteHeightMeters,
                          1.4f, Position);
                Physics.BodyType = BodyType.Dynamic;
                Physics.IsSensor = false;
                Physics.UserData = this;
                Physics.Mass = 75f;
                Physics.Friction = 0.01f;

                Physics.CollisionCategories = Category.All;
                Physics.CollidesWith = Category.All;

                initialized = true;
            }
            base.InitializePhysics(force, engineRegistrations);
        }
 public MacroSelectionPage() : base()
 {
     InitializeComponent();
     ViewModel = Autofac.Resolve <MacroSelectionViewModel>();
 }
Exemplo n.º 7
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            if (force || !initialized)
            {
                var world = engineRegistrations.Resolve<PhysicsManager>().World;
                Physics = BodyFactory.CreateBody(world, Position, this);

                float spriteWidthMeters = PhysicsConstants.PixelsToMeters(Width);
                float spriteHeightMeters = PhysicsConstants.PixelsToMeters(Height);

                var rect = FixtureFactory.AttachRectangle(
                    spriteWidthMeters,
                    spriteHeightMeters,
                    1.4f,
                    Vector2.Zero,
                    Physics);

                Physics.BodyType = BodyType.Static;
                Physics.IsSensor = true;

                initialized = true;
            }

            base.InitializePhysics(false, engineRegistrations);
        }
Exemplo n.º 8
0
 private static void WireupNavigation(Autofac.IContainer container)
 {
     var navController = container.Resolve<YunTai.NavigationController>();
     navController.Start();
 }
Exemplo n.º 9
0
        private static void StartLicensePlateMonitor(Autofac.IContainer container)
        {
            var factory = container.Resolve<LicensePlate.LicensePlateUploadMonitor.Factory>();

            var manager = container.Resolve<Damany.RemoteImaging.Common.ConfigurationManager>();
            foreach (var cam in manager.GetCameras())
            {
                if (cam.LicensePlateUploadDirectory != null)
                {
                    if (!System.IO.Directory.Exists(cam.LicensePlateUploadDirectory))
                    {
                        throw new System.IO.DirectoryNotFoundException(@"车牌上传目录 """ + cam.LicensePlateUploadDirectory + "\"不存在,请重新配置系统!");
                    }

                    var m = factory.Invoke(cam.LicensePlateUploadDirectory);
                    m.CameraId = cam.Id;
                    m.Configuration = (LicenseParsingConfig)System.Configuration.ConfigurationManager.GetSection("LicenseParsingConfig");
                    m.Start();
                    GC.KeepAlive(m);
                }
            }
        }
Exemplo n.º 10
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            base.InitializePhysics(force, engineRegistrations);
            var width = PhysicsConstants.PixelsToMeters(Width);
            var height = PhysicsConstants.PixelsToMeters(Height);
            var world = engineRegistrations.Resolve<PhysicsManager>().World;

            FixtureFactory.AttachRectangle(width, height, .1f, Vector2.Zero, Physics);

            Physics.BodyType = BodyType.Dynamic;
            Physics.IsSensor = false;
            Physics.UserData = this;
            Physics.Mass = 2f;
            Physics.Friction = 0.01f;
        }
Exemplo n.º 11
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            if (!initialized || force)
            {
                world = engineRegistrations.Resolve<PhysicsManager>().World;
                float spriteWidthMeters = PhysicsConstants.PixelsToMeters(Width);
                float spriteHeightMeters = PhysicsConstants.PixelsToMeters(Height / 2);

                Physics = BodyFactory.CreateRectangle(
                    world,
                    spriteWidthMeters, .2f,
                    300f, Position);
                Physics.Friction = 5f;
                Physics.Restitution = 0f;
                Physics.BodyType = BodyType.Static;
                Physics.IsSensor = true;
                Physics.UserData = this;
                Physics.CollidesWith = Category.Cat4;
                Physics.CollisionCategories = Category.Cat4;
                Physics.CollisionGroup = 1;

                Physics.RegisterOnSeparatedListener<UserControlledCharacter>(OnSeparation);
                Physics.RegisterOnCollidedListener<UserControlledCharacter>(OnCollidedWith);

                initialized = true;
            }

            base.InitializePhysics(false, engineRegistrations);
        }
Exemplo n.º 12
0
        public override void InitializePhysics(bool force, Autofac.IComponentContext engineRegistrations)
        {
            if (force || !initialized)
            {
                var world = engineRegistrations.Resolve<PhysicsManager>().World;
                var texture = engineRegistrations.Resolve<IResourceCache<Texture2D>>().GetResource(BASE_OFF);
                Physics = BodyFactory.CreateRectangle(
                    world,
                    PhysicsConstants.PixelsToMeters(texture.Width / 2),
                    PhysicsConstants.PixelsToMeters(texture.Height),
                    0,
                    Position,
                    this);
                Physics.Friction = .2f;
                Physics.FixedRotation = true;
                Physics.BodyType = BodyType.Static;
                Physics.IgnoreGravity = true;

                Physics.RegisterOnCollidedListener<EnergyBullet>(OnCollidedWith);

                gunRotation = Rotation;

                initialized = true;
            }

            base.InitializePhysics(force, engineRegistrations);
        }