public AGSCharacter(string id, Resolver resolver, IOutfit outfit) : base(id, resolver)
 {
     _hasRoom               = AddComponent <IHasRoom>();
     _animationContainer    = AddComponent <IAnimationContainer>();
     _inObjectTree          = AddComponent <IInObjectTree>();
     _collider              = AddComponent <ICollider>();
     _visibleComponent      = AddComponent <IVisibleComponent>();
     _enabledComponent      = AddComponent <IEnabledComponent>();
     _customProperties      = AddComponent <ICustomPropertiesComponent>();
     _drawableInfo          = AddComponent <IDrawableInfo>();
     _hotspotComponent      = AddComponent <IHotspotComponent>();
     _shaderComponent       = AddComponent <IShaderComponent>();
     _translateComponent    = AddComponent <ITranslateComponent>();
     _imageComponent        = AddComponent <IImageComponent>();
     _scaleComponent        = AddComponent <IScaleComponent>();
     _rotateComponent       = AddComponent <IRotateComponent>();
     _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>();
     _faceDirectionBehavior = AddComponent <IFaceDirectionBehavior>();
     _hasOutfit             = AddComponent <IHasOutfit>();
     _hasInventory          = AddComponent <IHasInventory>();
     _followBehavior        = AddComponent <IFollowBehavior>();
     _modelMatrixComponent  = AddComponent <IModelMatrixComponent>();
     beforeInitComponents(resolver, outfit);
     InitComponents();
     afterInitComponents(resolver, outfit);
 }
        public AGSCharacter(string id, Resolver resolver, IOutfit outfit) : base(id, resolver)
        {            
            _hasRoom = AddComponent<IHasRoom>();            
            _animationContainer = AddComponent<IAnimationContainer>();            
            _inObjectTree = AddComponent<IInObjectTree>();            
            _collider = AddComponent<ICollider>();            
            _visibleComponent = AddComponent<IVisibleComponent>();            
            _enabledComponent = AddComponent<IEnabledComponent>();            
            _customProperties = AddComponent<ICustomPropertiesComponent>();            
            _drawableInfo = AddComponent<IDrawableInfo>();            
            _hotspotComponent = AddComponent<IHotspotComponent>();            
            _shaderComponent = AddComponent<IShaderComponent>();            
            _transformComponent = AddComponent<ITranslateComponent>();            
            _imageComponent = AddComponent<IImageComponent>();            
            _scaleComponent = AddComponent<IScaleComponent>();            
            _rotateComponent = AddComponent<IRotateComponent>();            
            _pixelPerfectComponent = AddComponent<IPixelPerfectComponent>();            
            _faceDirectionBehavior = AddComponent<IFaceDirectionBehavior>();            
            _hasOutfit = AddComponent<IHasOutfit>();            
            _hasInventory = AddComponent<IHasInventory>();            
            _followBehavior = AddComponent<IFollowBehavior>();
			beforeInitComponents(resolver, outfit);            
			InitComponents();
            afterInitComponents(resolver, outfit);            
        }
        public AGSCheckBox(string id, Resolver resolver) : base(id, resolver)
        {            
            _uIEvents = AddComponent<IUIEvents>();            
            _skinComponent = AddComponent<ISkinComponent>();            
            _hasRoom = AddComponent<IHasRoom>();            
            _animationContainer = AddComponent<IAnimationContainer>();            
            _inObjectTree = AddComponent<IInObjectTree>();            
            _collider = AddComponent<ICollider>();            
            _visibleComponent = AddComponent<IVisibleComponent>();            
            _enabledComponent = AddComponent<IEnabledComponent>();            
            _customProperties = AddComponent<ICustomPropertiesComponent>();            
            _drawableInfo = AddComponent<IDrawableInfo>();            
            _hotspotComponent = AddComponent<IHotspotComponent>();            
            _shaderComponent = AddComponent<IShaderComponent>();            
            _translateComponent = AddComponent<ITranslateComponent>();            
            _imageComponent = AddComponent<IImageComponent>();            
            _scaleComponent = AddComponent<IScaleComponent>();            
            _rotateComponent = AddComponent<IRotateComponent>();            
            _pixelPerfectComponent = AddComponent<IPixelPerfectComponent>();            
            _textComponent = AddComponent<ITextComponent>();            
            _checkboxComponent = AddComponent<ICheckboxComponent>();
			beforeInitComponents(resolver);            
			InitComponents();
            afterInitComponents(resolver);            
        }
Esempio n. 4
0
 public AGSButton(string id, Resolver resolver) : base(id, resolver)
 {
     _uIEvents              = AddComponent <IUIEvents>();
     _skinComponent         = AddComponent <ISkinComponent>();
     _hasRoom               = AddComponent <IHasRoom>();
     _animationContainer    = AddComponent <IAnimationContainer>();
     _inObjectTree          = AddComponent <IInObjectTree>();
     _collider              = AddComponent <ICollider>();
     _visibleComponent      = AddComponent <IVisibleComponent>();
     _enabledComponent      = AddComponent <IEnabledComponent>();
     _customProperties      = AddComponent <ICustomPropertiesComponent>();
     _drawableInfo          = AddComponent <IDrawableInfo>();
     _hotspotComponent      = AddComponent <IHotspotComponent>();
     _shaderComponent       = AddComponent <IShaderComponent>();
     _translateComponent    = AddComponent <ITranslateComponent>();
     _imageComponent        = AddComponent <IImageComponent>();
     _scaleComponent        = AddComponent <IScaleComponent>();
     _rotateComponent       = AddComponent <IRotateComponent>();
     _pixelPerfectComponent = AddComponent <IPixelPerfectComponent>();
     _textComponent         = AddComponent <ITextComponent>();
     _buttonComponent       = AddComponent <IButtonComponent>();
     _modelMatrixComponent  = AddComponent <IModelMatrixComponent>();
     beforeInitComponents(resolver);
     InitComponents();
     afterInitComponents(resolver);
 }
Esempio n. 5
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _drawableInfo = entity.GetComponent <IDrawableInfo>();
     _obj          = entity.GetComponent <IAnimationContainer>();
     _scale        = entity.GetComponent <IScaleComponent>();
     _pixelPerfect = entity.GetComponent <IPixelPerfectComponent>();
 }
Esempio n. 6
0
		public override void Init(IEntity entity)
		{
			base.Init(entity);
			_drawableInfo = entity.GetComponent<IDrawableInfo>();
			_obj = entity.GetComponent<IAnimationContainer>();
            _scale = entity.GetComponent<IScaleComponent>();
            _pixelPerfect = entity.GetComponent<IPixelPerfectComponent>();
		}
Esempio n. 7
0
        public override void Init(IEntity entity)
        {
            base.Init(entity);
            IAnimationContainer animation      = entity.GetComponent <IAnimationContainer>();
            TypedParameter      animationParam = new TypedParameter(typeof(IAnimationContainer), animation);

            _pixelPerfect = _resolver.Resolve <IPixelPerfectCollidable>(animationParam);
        }
Esempio n. 8
0
		public ICharacter GetCharacter(string id, IOutfit outfit, IAnimationContainer container)
		{
			TypedParameter outfitParam = new TypedParameter (typeof(IOutfit), outfit);
			TypedParameter idParam = new TypedParameter (typeof(string), id);
			TypedParameter animationParam = new TypedParameter (typeof(IAnimationContainer), container);
			ICharacter character = _resolver.Resolve<ICharacter>(outfitParam, idParam, animationParam);
			return character;
		}
Esempio n. 9
0
        public ICharacter GetCharacter(string id, IOutfit outfit, IAnimationContainer container)
        {
            TypedParameter outfitParam    = new TypedParameter(typeof(IOutfit), outfit);
            TypedParameter idParam        = new TypedParameter(typeof(string), id);
            TypedParameter animationParam = new TypedParameter(typeof(IAnimationContainer), container);
            ICharacter     character      = _resolver.Resolve <ICharacter>(outfitParam, idParam, animationParam);

            return(character);
        }
Esempio n. 10
0
        public override void Init(IEntity entity)
        {
            base.Init(entity);
            _events    = entity.GetComponent <IUIEvents>();
            _animation = entity.GetComponent <IAnimationContainer>();

            _events.MouseEnter.Subscribe(onMouseEnter);
            _events.MouseLeave.Subscribe(onMouseLeave);
            _events.MouseUp.Subscribe(onMouseUp);
        }
Esempio n. 11
0
        public override void Init(IEntity entity)
        {
            base.Init(entity);
            _events = entity.GetComponent<IUIEvents>();
            _animation = entity.GetComponent<IAnimationContainer>();

            _events.MouseEnter.Subscribe(onMouseEnter);
            _events.MouseLeave.Subscribe(onMouseLeave);
            _events.MouseUp.Subscribe(onMouseUp);
        }
Esempio n. 12
0
        private async Task <AnimationCompletedEventArgs> animateWithTimeout(IAnimationContainer container, Task <AnimationCompletedEventArgs> task)
        {
            Task <AnimationCompletedEventArgs> timeoutTask = Task.Run(async() =>
            {
                await Task.Delay(10000);
                return((AnimationCompletedEventArgs)null);
            });
            Task <AnimationCompletedEventArgs> result = await Task.WhenAny(task, timeoutTask);

            Assert.AreEqual(task, result, "Animation timeout for " + container.GetType().Name);
            return(result.Result);
        }
Esempio n. 13
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _entity    = entity;
     _animation = entity.GetComponent <IAnimationContainer>();
     _tree      = entity.GetComponent <IInObjectTree>();
     _scale     = entity.GetComponent <IScaleComponent>();
     _translate = entity.GetComponent <ITranslateComponent>();
     _rotate    = entity.GetComponent <IRotateComponent>();
     _image     = entity.GetComponent <IImageComponent>();
     _room      = entity.GetComponent <IHasRoom>();
     _drawable  = entity.GetComponent <IDrawableInfo>();
 }
Esempio n. 14
0
 public Animator(IAnimationContainer container)
     : this()
 {
     this.container = container;
 }
 public AGSPixelPerfectCollidable(IAnimationContainer animation)
 {
     _animation = animation;
     _animation.OnAnimationStarted.Subscribe((sender, args) => PixelPerfect(_pixelPerfect));
 }
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _obj       = entity.GetComponent <IAnimationContainer>();
     _transform = entity.GetComponent <ITranslateComponent>();
 }
Esempio n. 17
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _animation = entity.GetComponent<IAnimationContainer>();
 }
		public override void Init(IEntity entity)
		{
			base.Init(entity);
			_obj = entity.GetComponent<IAnimationContainer>();
            _transform = entity.GetComponent<ITranslateComponent>();
		}
Esempio n. 19
0
 public AGSPixelPerfectCollidable(IAnimationContainer animation)
 {
     _animation = animation;
     _animation.OnAnimationStarted.Subscribe((sender, args) => PixelPerfect(_pixelPerfect));
 }
Esempio n. 20
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _animationContainer = entity.GetComponent <IAnimationContainer>();
     _scale = entity.GetComponent <IScaleComponent>();
 }
Esempio n. 21
0
		public Animator(IAnimationContainer container)
			: this() {
			this.container = container;
		}
		private async Task<AnimationCompletedEventArgs> animateWithTimeout(IAnimationContainer container, Task<AnimationCompletedEventArgs> task)
		{
			Task<AnimationCompletedEventArgs> timeoutTask = Task.Run(async () =>
			{
				await Task.Delay(10000);
				return (AnimationCompletedEventArgs)null;
			});
			Task<AnimationCompletedEventArgs> result = await Task.WhenAny(task, timeoutTask);
			Assert.AreEqual(task, result, "Animation timeout for " + container.GetType().Name);
			return result.Result;
		}