Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonCharacterSprite"/> class.
 /// </summary>
 /// <param name="getTime">The interface used to get the current time.</param>
 /// <param name="character">The character that this sprite is for.</param>
 /// <param name="skeletonManager">The skeleton manager.</param>
 /// <param name="speedModifier">The animation speed modifier.</param>
 public SkeletonCharacterSprite(IGetTime getTime, Entity character, SkeletonManager skeletonManager, float speedModifier)
 {
     _character = character;
     _skelManager = skeletonManager;
     _speedModifier = speedModifier;
     _getTime = getTime;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonCharacterSprite"/> class.
 /// </summary>
 /// <param name="getTime">The interface used to get the current time.</param>
 /// <param name="character">The character that this sprite is for.</param>
 /// <param name="skeletonManager">The skeleton manager.</param>
 /// <param name="speedModifier">The animation speed modifier.</param>
 public SkeletonCharacterSprite(IGetTime getTime, Entity character, SkeletonManager skeletonManager, float speedModifier)
 {
     _character     = character;
     _skelManager   = skeletonManager;
     _speedModifier = speedModifier;
     _getTime       = getTime;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes the Character.
        /// </summary>
        /// <param name="map">The Map to place the Character on.</param>
        /// <param name="skelManager">The SkeletonManager to use for the Character's skeletons.</param>
        public virtual void Initialize(Map map, SkeletonManager skelManager)
        {
            // HACK: This is quite a dirty way to do this
            _map = map;
            _interpolator.Teleport(Position);

            _characterSprite = CreateCharacterSprite(this, this, skelManager);

            CharacterSprite.SetSet(BodyInfo.Stand, BodyInfo.Size);
            CharacterSprite.SetBody(BodyInfo.Body);
        }
Esempio n. 4
0
        /// <summary>
        /// Creates the <see cref="ICharacterSprite"/> to be used by a <see cref="Character"/>.
        /// </summary>
        /// <param name="getTime">The <see cref="IGetTime"/> provider.</param>
        /// <param name="entity">The <see cref="Entity"/> the sprite is for (usually the <see cref="Character"/>).</param>
        /// <param name="skeletonManager">The <see cref="SkeletonManager"/> to use (ignored in TopDown builds).</param>
        /// <returns>The <see cref="ICharacterSprite"/> instance.</returns>
        public static ICharacterSprite CreateCharacterSprite(IGetTime getTime, Entity entity, SkeletonManager skeletonManager)
        {
#if !TOPDOWN
            return new SkeletonCharacterSprite(getTime, entity, skeletonManager, GameData.AnimationSpeedModifier);
#else
            return new GrhCharacterSprite(entity, "Character.Top Down");
#endif
        }
Esempio n. 5
0
        /// <summary>
        /// Creates the <see cref="ICharacterSprite"/> to be used by a <see cref="Character"/>.
        /// </summary>
        /// <param name="getTime">The <see cref="IGetTime"/> provider.</param>
        /// <param name="entity">The <see cref="Entity"/> the sprite is for (usually the <see cref="Character"/>).</param>
        /// <param name="skeletonManager">The <see cref="SkeletonManager"/> to use (ignored in TopDown builds).</param>
        /// <returns>The <see cref="ICharacterSprite"/> instance.</returns>
        public static ICharacterSprite CreateCharacterSprite(IGetTime getTime, Entity entity, SkeletonManager skeletonManager)
        {
#if SKELETON_SPRITES
            return new SkeletonCharacterSprite(getTime, entity, skeletonManager, GameData.AnimationSpeedModifier);
#else
            return new GrhCharacterSprite(entity, "Character");
#endif
        }