2019-11-20 11:30:28 +01:00
|
|
|
using System;
|
|
|
|
|
2019-06-22 17:24:50 +02:00
|
|
|
namespace Coroutine {
|
2019-11-20 11:30:28 +01:00
|
|
|
public struct WaitSeconds : IWait {
|
2019-06-22 17:24:50 +02:00
|
|
|
|
|
|
|
private double seconds;
|
|
|
|
|
|
|
|
public WaitSeconds(double seconds) {
|
|
|
|
this.seconds = seconds;
|
|
|
|
}
|
|
|
|
|
2019-11-20 11:30:28 +01:00
|
|
|
public WaitType GetWaitType() {
|
2019-06-22 17:24:50 +02:00
|
|
|
return WaitType.Tick;
|
|
|
|
}
|
|
|
|
|
2019-11-20 11:30:28 +01:00
|
|
|
public bool Tick(double deltaSeconds) {
|
2019-06-22 17:24:50 +02:00
|
|
|
this.seconds -= deltaSeconds;
|
|
|
|
return this.seconds <= 0;
|
|
|
|
}
|
|
|
|
|
2019-11-20 11:30:28 +01:00
|
|
|
public bool OnEvent(Event evt) {
|
|
|
|
throw new NotSupportedException();
|
|
|
|
}
|
|
|
|
|
2019-06-22 17:24:50 +02:00
|
|
|
}
|
|
|
|
}
|