Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);            
        }
Ejemplo n.º 3
0
        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);            
        }
Ejemplo 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);
 }
Ejemplo 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>();
 }
Ejemplo 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>();
		}
Ejemplo 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);
        }
Ejemplo 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;
		}
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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>();
 }
Ejemplo n.º 14
0
 public Animator(IAnimationContainer container)
     : this()
 {
     this.container = container;
 }
 public AGSPixelPerfectCollidable(IAnimationContainer animation)
 {
     _animation = animation;
     _animation.OnAnimationStarted.Subscribe((sender, args) => PixelPerfect(_pixelPerfect));
 }
Ejemplo n.º 16
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _obj       = entity.GetComponent <IAnimationContainer>();
     _transform = entity.GetComponent <ITranslateComponent>();
 }
Ejemplo 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>();
		}
Ejemplo n.º 19
0
 public AGSPixelPerfectCollidable(IAnimationContainer animation)
 {
     _animation = animation;
     _animation.OnAnimationStarted.Subscribe((sender, args) => PixelPerfect(_pixelPerfect));
 }
Ejemplo n.º 20
0
 public override void Init(IEntity entity)
 {
     base.Init(entity);
     _animationContainer = entity.GetComponent <IAnimationContainer>();
     _scale = entity.GetComponent <IScaleComponent>();
 }
Ejemplo n.º 21
0
		public Animator(IAnimationContainer container)
			: this() {
			this.container = container;
		}
Ejemplo n.º 22
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;
		}