using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; namespace CSVReader { public abstract class AbstractUnitCSVReader { protected readonly object LockObject; //BIN-Inhalte: int ID - double timestamp - 3x float coodrinates - 3x float rotation - 2x uint colors - int EntityType - int SensorID /// /// The Length of one dataline. /// int ID - double timestamp - 3x float coodrinates - 3x float rotation - 3x float head rotation - 2x uint colors - int EntityType - int SensorID /// protected readonly int ROWLENGTHINBYTES = 3 * sizeof(int) + sizeof(double) + 9 * sizeof(float) + 2 * sizeof(uint); /// /// The Binary reader on the file. /// protected BinaryReader Reader; /// /// Whether the Binaryreader was initialized correctly /// protected bool Defined = false; protected double ChunkStartTimestamp = double.NaN; protected double ChunkEndTimestamp = double.NaN; protected AbstractUnitCSVReader() { LockObject = new object(); } protected abstract InputObject ParseObject(); protected abstract double GetTimeAtRelativeOffset(long shift); protected abstract double GetTimeAtAbsolutPosition(long offset); protected abstract bool TestNewPosition(long newPos); protected abstract bool TestBinaryReader(); protected abstract bool IsStep(double newTime, double targetTime, int jumpdirection, bool forward); } }