///<summary> ///initialize using associated entity ///</summary> ///<param name="entity">associated entity</param> public void Initialize(Entity entity) { _graveMarker = entity as GraveMarker; SimpleMaterial simpleMaterial = new SimpleMaterial(); simpleMaterial.TextureFilename = @"data\images\Mindcrafters\gravestoneRIP"; simpleMaterial.IsTranslucent = true; simpleMaterial.IsColorBlended = true; Material = simpleMaterial; Layer = 30; IsTemplate = false; Size = new Vector2(32, 32)*2; }
///<summary> ///add a grave marker to the game ///</summary> ///<param name="position"></param> public void AddGrave(Vector2 position) { GraveMarker graveMarker = new GraveMarker( position, new Vector2(0, -1), //facing Instance.Parameters.GraveLifetime, new GraveSceneObject()); GraveMarkerList.Add(graveMarker); graveMarker.Name = "TempGraveName"; //register the grave with the entity manager EntityManager.Instance.RegisterEntity(graveMarker); graveMarker.Name = "GRAVE_" + graveMarker.ObjectId; LogUtil.WriteLineIfLogCreate("Adding a grave " + graveMarker.ObjectId + " at position " + graveMarker.Position); }