public override void Activation(MHEngine engine) { if (m_fRunning) { return; } base.Activation(engine); // We're supposed to apply Activation to each of the "items" but it isn't clear // exactly what that means. Assume it means each of the visibles. for (int i = 0; i < m_TokenGrpItems.Size; i++) { MHObjectRef pObject = m_TokenGrpItems.GetAt(i).Object; // The object reference may be the null reference. // Worse: it seems that sometimes in BBC's MHEG the reference simply doesn't exist. if (pObject.IsSet()) { try { engine.FindObject(m_TokenGrpItems.GetAt(i).Object).Activation(engine); } catch (MHEGException) {} } } engine.EventTriggered(this, EventTokenMovedTo, new MHUnion(m_nTokenPosition)); m_fRunning = true; engine.EventTriggered(this, EventIsRunning); }
public override void Print(TextWriter writer, int nTabs) { base.Print(writer, nTabs); Logging.PrintTabs(writer, nTabs); writer.Write(":OrigBoxSize {0} {1}\n", m_nOriginalBoxWidth, m_nOriginalBoxHeight); if (m_nOriginalPosX != 0 || m_nOriginalPosY != 0) { Logging.PrintTabs(writer, nTabs); writer.Write(":OrigPosition {0} {1}\n", m_nOriginalPosX, m_nOriginalPosY); } if (m_OriginalPaletteRef.IsSet()) { Logging.PrintTabs(writer, nTabs); writer.Write(":OrigPaletteRef"); m_OriginalPaletteRef.Print(writer, nTabs + 1); writer.Write("\n"); } }