public static GetDamComTeams ( Stream stream, int index ) : ReadOnlyCollection |
||
stream | Stream | |
index | int | |
return | ReadOnlyCollection |
public static ReadOnlyCollection<DamComStatus> GetDamComTeams(Stream stream, int index)
{
List<DamComStatus> retVal = new List<DamComStatus>();
if (stream != null)
{
int position = index;
stream.Position = position;
while (position < stream.Length && Convert.ToByte(stream.ReadByte()) != 0xfe)
{
DamComStatus d = new DamComStatus(stream, position);
retVal.Add(d);
position += PacketLength;
stream.Position = position;
}
}
return new ReadOnlyCollection<DamComStatus>(retVal);
}
public DamComStatus()
public EngGridUpdatePacket(byte[] byteArray) { if (_log.IsInfoEnabled) { _log.InfoFormat("{0}--bytes in: {1}", MethodBase.GetCurrentMethod().ToString(), Utility.BytesToDebugString(byteArray)); } Systems = SystemNode.GetNodes(byteArray); int index = 0; foreach (SystemNode node in Systems) { index += node.DataLength; } DamageControlTeams = DamComStatus.GetDamComTeams(byteArray, ++index); if (_log.IsInfoEnabled) { _log.InfoFormat("{0}--Result bytes: {1}", MethodBase.GetCurrentMethod().ToString(), Utility.BytesToDebugString(this.GetBytes())); } }