public Entity(Entity other) : base(other) { engine = other.engine; type = other.type; visual = EntityVisual.Empty; animationSetNames = new Dictionary <string, string>(other.animationSetNames); layerOrder = new Dictionary <int, IList <string> >(other.layerOrder); visible = other.visible; direction = other.direction; speed = other.speed; meleeRange = other.meleeRange; movementType = other.movementType; flying = other.flying; intangible = other.intangible; animationName = other.animationName; allowedToMove = other.allowedToMove; facing = other.facing; moveWithPath = other.moveWithPath; categories = new List <string>(other.categories); rarity = other.rarity; level = other.level; wander = other.wander; wayPointPause = other.wayPointPause; turnDelay = other.turnDelay; wayPoints = new List <FPoint>(other.wayPoints); wanderArea = other.wanderArea; path = new List <FPoint>(); }
public void CreateVisual() { if (animationSetNames.Count > 1) { var animationSets = new Dictionary <string, AnimationSet>(); foreach (var asn in animationSetNames) { var animSet = engine.LoadAnimationSet(asn.Value); if (animSet != null) { animationSets[asn.Key] = animSet; } } CreateVisual(animationSets); } else if (animationSetNames.Count == 1) { animationName = animationSetNames.Values.First(); var animationSet = engine.LoadAnimationSet(animationName); CreateVisual(animationSet); } else if (!string.IsNullOrEmpty(animationName)) { var animationSet = engine.LoadAnimationSet(animationName); CreateVisual(animationSet); } else { visual = EntityVisual.Empty; } }
public Entity(Engine engine, string name) : base(name) { this.engine = engine; visual = EntityVisual.Empty; animationSetNames = new Dictionary <string, string>(); layerOrder = new Dictionary <int, IList <string> >(); visible = true; dead = false; direction = 0; speed = 0.1f; meleeRange = 1.0f; mapDestX = -1; mapDestY = -1; movementType = MovementType.Normal; flying = false; intangible = false; allowedToMove = true; moveWithPath = true; facing = true; categories = new List <string>(); rarity = "common"; level = 1; wayPoints = new List <FPoint>(); path = new List <FPoint>(); wayPointPause = engine.MaxFramesPerSecond; turnDelay = engine.MaxFramesPerSecond; }
public void CreateVisual(IDictionary <string, AnimationSet> animationSets) { visual = new MultiPartEntityVisual(animationSets, layerOrder); }
public void CreateVisual(AnimationSet animationSet) { visual = new EntityVisual(animationSet); }