private IEnumerable <IAnimationComponent> getImplementors()
 {
     foreach (var container in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         yield return(container);
     }
 }
Пример #2
0
		public void SaveLoad_ButtonInPanel_Test()
		{
			List<IObject> objs = ObjectTests.GetImplementors(_mocks, null, _state).ToList();
			IPanel panel = (IPanel)objs.First(o => o is IPanel);
			IButton button = (IButton)objs.First(o => o is IButton);
			button.TreeNode.SetParent(panel.TreeNode);

			setupObject(panel);
			setupObject(button);

			_saveLoad.Save("test");
			_saveLoad.Load("test");

			Assert.AreEqual(1, _state.Rooms.Count);
			Assert.AreEqual(2, _state.Rooms[0].Objects.Count);

			panel = null;
			button = null;
			foreach (IObject obj in _state.Rooms[0].Objects)
			{
				testObject(obj);
				if (button == null) button = obj as IButton;
				if (!(obj is IButton)) panel = obj as IPanel;
			}
		    Assert.IsNotNull(button);
		    Assert.IsNotNull(panel);
			Assert.AreSame(button.TreeNode.Parent, panel);
			Assert.AreSame(button.TreeNode.Parent, panel.TreeNode.Node);

			RenderOrderSelector comparer = new RenderOrderSelector ();
			Assert.AreEqual(1, comparer.Compare(button, panel));
			Assert.AreEqual(-1, comparer.Compare(panel, button));

			clearState();
		}
Пример #3
0
        private IEnumerable <IHasModelMatrix> getImplementors()
        {
            foreach (var sprite in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
            {
                yield return(sprite);
            }
            var resolver = ObjectTests.GetResolver();

            resolver.Build();
            yield return(new AGSSprite(resolver, _mocks.MaskLoader().Object));
        }
Пример #4
0
        private IEnumerable <IHasModelMatrix> getImplementors()
        {
            foreach (var sprite in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
            {
                //todo: Fix scaling for labels
                if (sprite is AGSLabel || sprite is AGSButton)
                {
                    continue;
                }

                yield return(sprite);
            }
            var resolver = ObjectTests.GetResolver();

            resolver.Build();
            yield return(new AGSSprite(resolver, _mocks.MaskLoader().Object));
        }
Пример #5
0
        public void SaveLoad_Object_Test()
        {
            foreach (IObject obj in ObjectTests.GetImplementors(_mocks, null, _state))
            {
                setupObject(obj);

                _saveLoad.Save("test");
                _saveLoad.Load("test");

                Assert.AreEqual(1, _state.Rooms.Count);
                Assert.AreEqual(1, _state.Rooms[0].Objects.Count);

                IObject actual = _state.Rooms[0].Objects.First();
                testObject(actual);

                clearState();
            }
        }