Parking/Assets/Scripts/Driver.cs
2022-09-03 00:23:15 +02:00

61 lines
1.3 KiB
C#

using System;
using Unity.VisualScripting;
using UnityEngine;
namespace Parking
{
public class Driver
{
public ParkingPreference ParkingPreference = ParkingPreference.Any;
public int Priority;
public readonly Size Size;
public DateTime[] Times;
public Spot Spot;
public bool Parked = false;
public GameObject GameObject;
public bool Rejected = false;
public Driver(Size size, int priority, ParkingPreference parkingPreference)
{
Size = size;
Priority = priority;
ParkingPreference = parkingPreference;
}
}
public class Spot : IComparable<Spot>
{
public Size Size;
public bool Flipped;
public GameObject GameObject;
public bool Free = true;
public ParkingPreference ParkingDirection = ParkingPreference.Any;
public Spot(Size size, bool flipped)
{
Size = size;
Flipped = flipped;
}
public int CompareTo(Spot obj)
{
return Size.CompareTo(obj.Size);
}
}
public enum Size
{
A = 0,
B = 1,
C = 2,
D = 3
}
public enum ParkingPreference
{
Any = 0,
Front = 1,
Back = 2
}
}