초기커밋
This commit is contained in:
42
GameServer/Contents/Rental/Action/RentalAction.cs
Normal file
42
GameServer/Contents/Rental/Action/RentalAction.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user