32 lines
709 B
PHP
32 lines
709 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/** A timed effect. The engine runs due events in (fire_at, id) order. */
|
|
class GameEvent extends Model
|
|
{
|
|
public const BUILD_ORDER_FINISHED = 'build_order.finished';
|
|
|
|
public const BARBARIAN_GROWS = 'barbarian.grows';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $dateFormat = 'Y-m-d H:i:s.v';
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'fire_at' => 'immutable_datetime',
|
|
'processed_at' => 'immutable_datetime',
|
|
];
|
|
}
|
|
|
|
public function village(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Village::class);
|
|
}
|
|
}
|