43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GameServer
|
|
{
|
|
internal class RentalAction : EntityActionBase
|
|
{
|
|
public RentalAction(Rental owner)
|
|
: base(owner)
|
|
{ }
|
|
|
|
public override async Task<Result> onInit()
|
|
{
|
|
var result = new Result();
|
|
return await Task.FromResult(result);
|
|
}
|
|
|
|
public override void onClear()
|
|
{
|
|
return;
|
|
}
|
|
|
|
public bool isRentalFinsh()
|
|
{
|
|
var rental = getOwner() as Rental;
|
|
NullReferenceCheckHelper.throwIfNull(rental, () => $"rental is null !!!");
|
|
|
|
var rental_attribute = rental.getEntityAttribute<RentalAttribute>();
|
|
NullReferenceCheckHelper.throwIfNull(rental_attribute, () => $"rental_attribute is null !!!");
|
|
|
|
if (DateTime.UtcNow > rental_attribute.RentalFinishTime)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|