1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace CSVReader
- {
- public enum EventType { CARCRASH, FALLINGPERSON, CONFETTICANNON, EXPLOSION }
- public class EventObject
- {
- public int ID;
- public double TimestampStart;
- public double TimestampEnd = -1;
- public Vector3 Pos;
- public Vector3 IdealViewingPos;
- public bool IdealViewingPosSet = false;
- public EventType Type;
- public EventObject(int id, double startingtime, float posX, float posY, float posZ, EventType type)
- {
- this.ID = id;
- this.TimestampStart = startingtime;
- this.Pos = new Vector3(posX, posY, posZ);
- this.Type = type;
- }
- public void setIdealViewingPosition(float posX, float posY, float posZ)
- {
- this.IdealViewingPos = new Vector3(posX, posY, posZ);
- IdealViewingPosSet = true;
- }
- public bool Equals(EventObject comEve)
- {
- if (this.IdealViewingPos == null)
- {
- if (comEve.IdealViewingPos == null)
- {
- return this.ID == comEve.ID && this.TimestampStart == comEve.TimestampStart && this.TimestampEnd == comEve.TimestampEnd &&
- this.Pos.x == comEve.Pos.x && this.Pos.y == comEve.Pos.y && this.Pos.z == comEve.Pos.z && this.Type == comEve.Type;
- }
- else
- {
- return false;
- }
- }
- return this.ID == comEve.ID && this.TimestampStart == comEve.TimestampStart && this.TimestampEnd == comEve.TimestampEnd &&
- this.Pos.x == comEve.Pos.x && this.Pos.y == comEve.Pos.y && this.Pos.z == comEve.Pos.z && this.Type == comEve.Type &&
- this.IdealViewingPos.x == comEve.IdealViewingPos.x && this.IdealViewingPos.y == comEve.IdealViewingPos.y &&
- this.IdealViewingPos.z == comEve.IdealViewingPos.z;
-
- }
- }
- }
|