12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Reflection;
- using UnityEngine;
- namespace CSVReader
- {
- public enum EntityType {PERSON, CAR,TRUCK, BIKE}
- public class InputObject
- {
- public int ID;
- public double Time;
- public Vector3 Pos;
- public Vector3 Rot;
- public Vector3 HeadRot;
- public uint TopColor;
- public uint BotColor;
- public EntityType Type;
- public int SensorID;
- public InputObject(int id, double time, float posX, float posY, float posZ, float rotX, float rotY, float rotZ, float rotHeadX, float rotHeadY, float rotHeadZ,
- uint topColor, uint botColor, EntityType type, int sensorID)
- {
- this.Time = time;
- this.ID = id;
- Pos = new Vector3(posX, posY, posZ);
- Rot = new Vector3(rotX, rotY, rotZ);
- HeadRot = new Vector3(rotHeadX, rotHeadY, rotHeadZ);
- this.TopColor = topColor;
- this.BotColor = botColor;
- this.Type = type;
- this.SensorID = sensorID;
- }
- public override bool Equals(object obj)
- {
- if (obj is InputObject)
- {
- InputObject other = obj as InputObject;
- bool equal = true;
- PropertyInfo[] properties = typeof(InputObject).GetProperties();
- foreach (PropertyInfo property in properties)
- {
- equal = property.GetValue(this).Equals(property.GetValue(other));
- }
- return equal;
- }
- else
- return false;
- }
- }
- }
|