public bool Validate(Validator v, string sIdentity, OTTable table) { bool bRet = true; bRet &= ((val_BASE)table).ValidateNoOverlap(m_offsetBaseScriptListTable, CalcLength(), v, sIdentity, table.GetTag()); bool bOrderOk = true; if (BaseScriptCount > 1) { for (uint i = 0; i < BaseScriptCount - 1; i++) { BaseScriptRecord ThisBsr = GetBaseScriptRecord(i); BaseScriptRecord NextBsr = GetBaseScriptRecord(i + 1); if (ThisBsr.BaseScriptTag >= NextBsr.BaseScriptTag) { v.Error(T.T_NULL, E.BASE_E_BaseScriptList_Order, table.m_tag, sIdentity); bOrderOk = false; bRet = false; break; } } } if (bOrderOk) { v.Pass(T.T_NULL, P.BASE_P_BaseScriptList_Order, table.m_tag, sIdentity); } bool bOffsetsOk = true; for (uint i = 0; i < BaseScriptCount; i++) { BaseScriptRecord bsr = GetBaseScriptRecord(i); if (bsr.BaseScriptOffset + m_offsetBaseScriptListTable > m_bufTable.GetLength()) { v.Error(T.T_NULL, E.BASE_E_BaseScriptList_Offset, table.m_tag, sIdentity + ", index = " + i); bOffsetsOk = false; bRet = false; } } if (bOffsetsOk) { v.Pass(T.T_NULL, P.BASE_P_BaseScriptList_Offset, table.m_tag, sIdentity); } for (uint i = 0; i < BaseScriptCount; i++) { BaseScriptRecord bsr = GetBaseScriptRecord(i); BaseScriptTable_val bst = GetBaseScriptTable_val(bsr); bst.Validate(v, sIdentity + ", BaseScriptRecord[" + i + "](" + bsr.BaseScriptTag + ")", table); } return(bRet); }
public BaseScriptTable_val GetBaseScriptTable_val(BaseScriptRecord bsr) { BaseScriptTable_val bst = null; if (bsr != null) { ushort offset = (ushort)(m_offsetBaseScriptListTable + bsr.BaseScriptOffset); bst = new BaseScriptTable_val(offset, m_bufTable); } return(bst); }
public BaseScriptTable_val GetBaseScriptTable_val(BaseScriptRecord bsr) { BaseScriptTable_val bst = null; if (bsr != null) { ushort offset = (ushort)(m_offsetBaseScriptListTable + bsr.BaseScriptOffset); bst = new BaseScriptTable_val(offset, m_bufTable); } return bst; }