From 39eaa15b5026e7d0451cb1fdf8654094a2bd57c6 Mon Sep 17 00:00:00 2001 From: Simon Holmberg Date: Thu, 27 Sep 2012 19:30:35 +0200 Subject: [PATCH] Base Entity keeps track of core --- DepthsBelow/DepthsBelow/Entity.cs | 5 ++++- DepthsBelow/DepthsBelow/Soldier.cs | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DepthsBelow/DepthsBelow/Entity.cs b/DepthsBelow/DepthsBelow/Entity.cs index e68e706..673958d 100644 --- a/DepthsBelow/DepthsBelow/Entity.cs +++ b/DepthsBelow/DepthsBelow/Entity.cs @@ -11,9 +11,12 @@ namespace DepthsBelow List Components; public Component.PixelTransform pixelTransform; public Component.GridTransform gridTransform; + private Core core; - public Entity() + public Entity(Core core) { + this.core = core; + Components = new List(); pixelTransform = new Component.PixelTransform(this); AddComponent(pixelTransform); diff --git a/DepthsBelow/DepthsBelow/Soldier.cs b/DepthsBelow/DepthsBelow/Soldier.cs index fa3cf02..f9911de 100644 --- a/DepthsBelow/DepthsBelow/Soldier.cs +++ b/DepthsBelow/DepthsBelow/Soldier.cs @@ -11,14 +11,11 @@ namespace DepthsBelow public static Texture2D Texture; public static Point Origin; private bool _selected; - private Core game; private KeyboardState lastKeyboardState; - public Soldier(Core game) + public Soldier(Core core) : base(core) { - this.game = game; - if (Texture == null) LoadContent(game);