//------------------------------------------------------------------------- /// <summary> /// Entity constructor. /// </summary> /// <param name="drawable">This Entity's drawable.</param> /// <param name="active">Initial active status of this Entity</param> public Entity(Drawable drawable, bool active = true) { _drawable = drawable; _color = Color.White; _active = active; _directionView = Direction.DIR_N; _animationState = AnimationState.ANIMSTATE_IDLE; _stateTime = 0.0f; }
//------------------------------------------------------------------------- /// <summary> /// Load a Drawable XML file. /// </summary> /// <param name="name">Name of XML Drawable file</param> /// <returns>Loaded Drawable</returns> public Drawable loadDrawable(String name) { // Verify this Drawable has not already been loaded if (_objects.ContainsKey(name)) return _objects[name] as Drawable; #if DEBUG Console.WriteLine("Loading Drawable: " + name); #endif // Load DrawableData DrawableData data = _contentMgr.Load<DrawableData>(DIR_DRAWABLES + name); // Load new Drawable Drawable drawable = new Drawable( name, loadTexture(data.TextureName), data.Origin); // Add to ContentManager addContentObject(drawable); return drawable; }