private void SetStats(EntityStats stats) { this.X = stats.X; this.Y = stats.Y; this.Speed = stats.Speed; this.CollisionMask = stats.CollisionMask; }
// --------------------------------------------------------------------------------------------------------- #endregion public static void Init(ref Canvas canvas, EntityStats playerStats, List <EntityStats> entityStats) { Canvas = canvas; Player = new Entity(playerStats); if (entityStats != null) { foreach (EntityStats stats in entityStats) { Entities.Add(new Entity(stats)); } } }
public Entity(EntityStats stats, Canvas canvas) { SetStats(stats); AddToCanvas(canvas); }
// --------------------------------------------------------------------------------------------------------- #endregion #region Constructors // --------------------------------------------------------------------------------------------------------- public Entity(EntityStats stats) { SetStats(stats); }