Ejemplo n.º 1
0
        public void LoadUserProfile()
        {
            var resolver     = new FileAssetResolver(PathUtils.ExecutingAssemblyDirectory);
            var assetManager = new AssetManager(resolver);
            var userProfile  = assetManager.Load <UserProfile>("userProfile.xml");

            Assert.AreEqual(userProfile.Name, "AssetManagementBase");
            Assert.AreEqual(userProfile.Score, 10000);
        }
Ejemplo n.º 2
0
        public void WrongPath()
        {
            var resolver     = new FileAssetResolver(PathUtils.ExecutingAssemblyDirectory);
            var assetManager = new AssetManager(resolver);

            Assert.Throws <Exception>(() =>
            {
                var userProfile = assetManager.Load <UserProfile>("userProfile2.xml");
            });
        }
Ejemplo n.º 3
0
        protected override void LoadContent()
        {
            base.LoadContent();

            var assetResolver = new FileAssetResolver(Path.Combine(PathUtils.ExecutingAssemblyDirectory, "Assets"));

            AssetManager = new AssetManager(GraphicsDevice, assetResolver);

            _font    = AssetManager.Load <SpriteFont>("fonts/arial64.fnt");
            _texture = AssetManager.Load <Texture2D>("images/LogoOnly_64px.png");

            _userProfile = AssetManager.Load <UserProfile>("userProfile.xml");

            _spriteBatch = new SpriteBatch(GraphicsDevice);
        }