public override void Dispose() { if (!IsDisposed) { m_blacksmith.Dispose(); m_blacksmith = null; m_blacksmithIcon.Dispose(); m_blacksmithIcon = null; m_blacksmithNewIcon.Dispose(); m_blacksmithNewIcon = null; m_blacksmithBoard.Dispose(); m_blacksmithBoard = null; m_enchantress.Dispose(); m_enchantress = null; m_enchantressIcon.Dispose(); m_enchantressIcon = null; m_enchantressNewIcon.Dispose(); m_enchantressNewIcon = null; m_tent.Dispose(); m_tent = null; m_architect.Dispose(); m_architect = null; m_architectIcon.Dispose(); m_architectIcon = null; m_screw.Dispose(); m_screw = null; if (m_blacksmithAnvilSound != null) { m_blacksmithAnvilSound.Dispose(); } m_blacksmithAnvilSound = null; m_tree1 = null; m_tree2 = null; m_tree3 = null; m_fern1 = null; m_fern2 = null; m_fern3 = null; foreach (var current in m_rainFG) { current.Dispose(); } m_rainFG.Clear(); m_rainFG = null; m_mountain1 = null; m_mountain2 = null; m_tollCollector.Dispose(); m_tollCollector = null; m_tollCollectorIcon.Dispose(); m_tollCollectorIcon = null; m_blacksmithBlock = null; m_enchantressBlock = null; m_architectBlock = null; if (m_rainSFX != null) { m_rainSFX.Dispose(); } m_rainSFX = null; base.Dispose(); } }
public StartingRoomObj() { m_blacksmith = new BlacksmithObj(); m_blacksmith.Flip = SpriteEffects.FlipHorizontally; m_blacksmith.Scale = new Vector2(2.5f, 2.5f); m_blacksmith.Position = new Vector2(700f, 660f - (m_blacksmith.Bounds.Bottom - m_blacksmith.Y) - 1f); m_blacksmith.OutlineWidth = 2; m_blacksmithBoard = new SpriteObj("StartRoomBlacksmithBoard_Sprite"); m_blacksmithBoard.Scale = new Vector2(2f, 2f); m_blacksmithBoard.OutlineWidth = 2; m_blacksmithBoard.Position = new Vector2(m_blacksmith.X - m_blacksmithBoard.Width / 2 - 35f, m_blacksmith.Bounds.Bottom - m_blacksmithBoard.Height - 1); m_blacksmithIcon = new SpriteObj("UpArrowBubble_Sprite"); m_blacksmithIcon.Scale = new Vector2(2f, 2f); m_blacksmithIcon.Visible = false; m_blacksmithIconPosition = new Vector2(m_blacksmith.X - 60f, m_blacksmith.Y - 10f); m_blacksmithIcon.Flip = m_blacksmith.Flip; m_blacksmithIcon.OutlineWidth = 2; m_blacksmithNewIcon = new SpriteObj("ExclamationSquare_Sprite"); m_blacksmithNewIcon.Visible = false; m_blacksmithNewIcon.OutlineWidth = 2; m_enchantressNewIcon = (m_blacksmithNewIcon.Clone() as SpriteObj); m_enchantress = new ObjContainer("Enchantress_Character"); m_enchantress.Scale = new Vector2(2f, 2f); m_enchantress.Flip = SpriteEffects.FlipHorizontally; m_enchantress.Position = new Vector2(1150f, 660f - (m_enchantress.Bounds.Bottom - m_enchantress.AnchorY) - 2f); m_enchantress.PlayAnimation(); m_enchantress.AnimationDelay = 0.1f; (m_enchantress.GetChildAt(4) as IAnimateableObj).StopAnimation(); m_enchantress.OutlineWidth = 2; m_tent = new SpriteObj("StartRoomGypsyTent_Sprite"); m_tent.Scale = new Vector2(1.5f, 1.5f); m_tent.OutlineWidth = 2; m_tent.Position = new Vector2(m_enchantress.X - m_tent.Width / 2 + 5f, m_enchantress.Bounds.Bottom - m_tent.Height); m_enchantressIcon = new SpriteObj("UpArrowBubble_Sprite"); m_enchantressIcon.Scale = new Vector2(2f, 2f); m_enchantressIcon.Visible = false; m_enchantressIconPosition = new Vector2(m_enchantress.X - 60f, m_enchantress.Y - 100f); m_enchantressIcon.Flip = m_enchantress.Flip; m_enchantressIcon.OutlineWidth = 2; m_architect = new ObjContainer("ArchitectIdle_Character"); m_architect.Flip = SpriteEffects.FlipHorizontally; m_architect.Scale = new Vector2(2f, 2f); m_architect.Position = new Vector2(1550f, 660f - (m_architect.Bounds.Bottom - m_architect.AnchorY) - 2f); m_architect.PlayAnimation(); m_architect.AnimationDelay = 0.1f; m_architect.OutlineWidth = 2; (m_architect.GetChildAt(1) as IAnimateableObj).StopAnimation(); m_architectIcon = new SpriteObj("UpArrowBubble_Sprite"); m_architectIcon.Scale = new Vector2(2f, 2f); m_architectIcon.Visible = false; m_architectIconPosition = new Vector2(m_architect.X - 60f, m_architect.Y - 100f); m_architectIcon.Flip = m_architect.Flip; m_architectIcon.OutlineWidth = 2; m_architectRenovating = false; m_screw = new SpriteObj("ArchitectGear_Sprite"); m_screw.Scale = new Vector2(2f, 2f); m_screw.OutlineWidth = 2; m_screw.Position = new Vector2(m_architect.X + 30f, m_architect.Bounds.Bottom - 1); m_screw.AnimationDelay = 0.1f; m_tollCollector = new PhysicsObjContainer("NPCTollCollectorIdle_Character"); m_tollCollector.Flip = SpriteEffects.FlipHorizontally; m_tollCollector.Scale = new Vector2(2.5f, 2.5f); m_tollCollector.IsWeighted = false; m_tollCollector.IsCollidable = true; m_tollCollector.Position = new Vector2(2565f, 420f - (m_tollCollector.Bounds.Bottom - m_tollCollector.AnchorY)); m_tollCollector.PlayAnimation(); m_tollCollector.AnimationDelay = 0.1f; m_tollCollector.OutlineWidth = 2; m_tollCollector.CollisionTypeTag = 1; m_tollCollectorIcon = new SpriteObj("UpArrowBubble_Sprite"); m_tollCollectorIcon.Scale = new Vector2(2f, 2f); m_tollCollectorIcon.Visible = false; m_tollCollectorIcon.Flip = m_tollCollector.Flip; m_tollCollectorIcon.OutlineWidth = 2; m_rainFG = new List <RaindropObj>(); var num = 400; if (LevelEV.SAVE_FRAMES) { num /= 2; } for (var i = 0; i < num; i++) { var item = new RaindropObj(new Vector2(CDGMath.RandomInt(-100, 2540), CDGMath.RandomInt(-400, 720))); m_rainFG.Add(item); } }