Parking/Assets/Scripts/Driver.cs

61 lines
1.3 KiB
C#
Raw Normal View History

2022-08-25 18:38:38 +02:00
using System;
using Unity.VisualScripting;
using UnityEngine;
2022-08-25 18:38:38 +02:00
namespace Parking
2022-08-25 18:38:38 +02:00
{
public class Driver
{
public ParkingPreference ParkingPreference = ParkingPreference.Any;
public int Priority;
2022-08-31 21:19:20 +02:00
public readonly Size Size;
2022-09-01 22:31:57 +02:00
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;
}
}
2022-08-25 18:38:38 +02:00
public class Spot : IComparable<Spot>
2022-08-25 18:38:38 +02:00
{
public Size Size;
public bool Flipped;
public GameObject GameObject;
2022-09-01 22:31:57 +02:00
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);
}
2022-08-25 18:38:38 +02:00
}
2022-08-25 18:38:38 +02:00
public enum Size
{
A = 0,
B = 1,
C = 2,
D = 3
}
2022-08-25 18:38:38 +02:00
public enum ParkingPreference
{
Any = 0,
Front = 1,
Back = 2
}
2022-08-25 18:38:38 +02:00
}