mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-22 03:59:35 +08:00
添加事件
This commit is contained in:
parent
626a17b1e8
commit
77fc7042e4
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Api.Factory
|
namespace Milimoe.FunGame.Core.Api.Factory
|
||||||
{
|
{
|
||||||
public class StockFactory
|
public class InventoryFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
57
FunGame.Core/Entity/Event/BuyItemEvent.cs
Normal file
57
FunGame.Core/Entity/Event/BuyItemEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class BuyItemEvent : IBuyItemEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeBuyItemEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterBuyItemEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedBuyItemEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedBuyItemEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeBuyItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeBuyItemEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeBuyItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterBuyItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterBuyItemEvent != null)
|
||||||
|
{
|
||||||
|
return AfterBuyItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedBuyItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedBuyItemEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedBuyItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedBuyItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedBuyItemEvent != null)
|
||||||
|
{
|
||||||
|
return FailedBuyItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/ChangeAccountSettingEvent.cs
Normal file
57
FunGame.Core/Entity/Event/ChangeAccountSettingEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class ChangeAccountSettingEvent : IChangeAccountSettingEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeChangeAccountSettingEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterChangeAccountSettingEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedChangeAccountSettingEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedChangeAccountSettingEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeChangeAccountSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeChangeAccountSettingEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeChangeAccountSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterChangeAccountSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterChangeAccountSettingEvent != null)
|
||||||
|
{
|
||||||
|
return AfterChangeAccountSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedChangeAccountSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedChangeAccountSettingEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedChangeAccountSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedChangeAccountSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedChangeAccountSettingEvent != null)
|
||||||
|
{
|
||||||
|
return FailedChangeAccountSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/ChangeProfileEvent.cs
Normal file
57
FunGame.Core/Entity/Event/ChangeProfileEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class ChangeProfileEvent : IChangeProfileEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeChangeProfileEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterChangeProfileEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedChangeProfileEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedChangeProfileEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeChangeProfileEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeChangeProfileEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeChangeProfileEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterChangeProfileEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterChangeProfileEvent != null)
|
||||||
|
{
|
||||||
|
return AfterChangeProfileEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedChangeProfileEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedChangeProfileEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedChangeProfileEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedChangeProfileEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedChangeProfileEvent != null)
|
||||||
|
{
|
||||||
|
return FailedChangeProfileEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/ChangeRoomSettingEvent.cs
Normal file
57
FunGame.Core/Entity/Event/ChangeRoomSettingEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class ChangeRoomSettingEvent : IChangeRoomSettingEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeChangeRoomSettingEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterChangeRoomSettingEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedChangeRoomSettingEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedChangeRoomSettingEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeChangeRoomSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeChangeRoomSettingEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeChangeRoomSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterChangeRoomSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterChangeRoomSettingEvent != null)
|
||||||
|
{
|
||||||
|
return AfterChangeRoomSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedChangeRoomSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedChangeRoomSettingEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedChangeRoomSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedChangeRoomSettingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedChangeRoomSettingEvent != null)
|
||||||
|
{
|
||||||
|
return FailedChangeRoomSettingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/CreateRoomEvent.cs
Normal file
57
FunGame.Core/Entity/Event/CreateRoomEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class CreateRoomEvent : ICreateRoomEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeCreateRoomEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterCreateRoomEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedCreateRoomEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedCreateRoomEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeCreateRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeCreateRoomEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeCreateRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterCreateRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterCreateRoomEvent != null)
|
||||||
|
{
|
||||||
|
return AfterCreateRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedCreateRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedCreateRoomEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedCreateRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedCreateRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedCreateRoomEvent != null)
|
||||||
|
{
|
||||||
|
return FailedCreateRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/EndGameEvent.cs
Normal file
57
FunGame.Core/Entity/Event/EndGameEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class EndGameEvent : IEndGameEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeEndGameEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterEndGameEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedEndGameEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedEndGameEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeEndGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeEndGameEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeEndGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterEndGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterEndGameEvent != null)
|
||||||
|
{
|
||||||
|
return AfterEndGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedEndGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedEndGameEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedEndGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedEndGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedEndGameEvent != null)
|
||||||
|
{
|
||||||
|
return FailedEndGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/IntoRoomEvent.cs
Normal file
57
FunGame.Core/Entity/Event/IntoRoomEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class IntoRoomEvent : IIntoRoomEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeIntoRoomEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterIntoRoomEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedIntoRoomEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedIntoRoomEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeIntoRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeIntoRoomEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeIntoRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterIntoRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterIntoRoomEvent != null)
|
||||||
|
{
|
||||||
|
return AfterIntoRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedIntoRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedIntoRoomEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedIntoRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedIntoRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedIntoRoomEvent != null)
|
||||||
|
{
|
||||||
|
return FailedIntoRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/LoginEvent.cs
Normal file
57
FunGame.Core/Entity/Event/LoginEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class LoginEvent : ILoginEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeLoginEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterLoginEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedLoginEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedLoginEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeLoginEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeLoginEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeLoginEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterLoginEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterLoginEvent != null)
|
||||||
|
{
|
||||||
|
return AfterLoginEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedLoginEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedLoginEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedLoginEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedLoginEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedLoginEvent != null)
|
||||||
|
{
|
||||||
|
return FailedLoginEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/LogoutEvent.cs
Normal file
57
FunGame.Core/Entity/Event/LogoutEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class LogoutEvent : ILogoutEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeLogoutEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterLogoutEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedLogoutEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedLogoutEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeLogoutEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeLogoutEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeLogoutEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterLogoutEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterLogoutEvent != null)
|
||||||
|
{
|
||||||
|
return AfterLogoutEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedLogoutEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedLogoutEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedLogoutEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedLogoutEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedLogoutEvent != null)
|
||||||
|
{
|
||||||
|
return FailedLogoutEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/OpenInventoryEvent.cs
Normal file
57
FunGame.Core/Entity/Event/OpenInventoryEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class OpenInventoryEvent : IOpenInventoryEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeOpenInventoryEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterOpenInventoryEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedOpenInventoryEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedOpenInventoryEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeOpenInventoryEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeOpenInventoryEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeOpenInventoryEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterOpenInventoryEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterOpenInventoryEvent != null)
|
||||||
|
{
|
||||||
|
return AfterOpenInventoryEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedOpenInventoryEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedOpenInventoryEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedOpenInventoryEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedOpenInventoryEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedOpenInventoryEvent != null)
|
||||||
|
{
|
||||||
|
return FailedOpenInventoryEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/OpenStoreEvent.cs
Normal file
57
FunGame.Core/Entity/Event/OpenStoreEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class OpenStoreEvent : IOpenStoreEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeOpenStoreEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterOpenStoreEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedOpenStoreEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedOpenStoreEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeOpenStoreEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeOpenStoreEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeOpenStoreEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterOpenStoreEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterOpenStoreEvent != null)
|
||||||
|
{
|
||||||
|
return AfterOpenStoreEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedOpenStoreEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedOpenStoreEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedOpenStoreEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedOpenStoreEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedOpenStoreEvent != null)
|
||||||
|
{
|
||||||
|
return FailedOpenStoreEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/QuitRoomEvent.cs
Normal file
57
FunGame.Core/Entity/Event/QuitRoomEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class QuitRoomEvent : IQuitRoomEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeQuitRoomEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterQuitRoomEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedQuitRoomEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedQuitRoomEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeQuitRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeQuitRoomEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeQuitRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterQuitRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterQuitRoomEvent != null)
|
||||||
|
{
|
||||||
|
return AfterQuitRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedQuitRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedQuitRoomEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedQuitRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedQuitRoomEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedQuitRoomEvent != null)
|
||||||
|
{
|
||||||
|
return FailedQuitRoomEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/RegEvent.cs
Normal file
57
FunGame.Core/Entity/Event/RegEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class RegEvent : IRegEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeRegEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterRegEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedRegEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedRegEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeRegEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeRegEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeRegEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterRegEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterRegEvent != null)
|
||||||
|
{
|
||||||
|
return AfterRegEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedRegEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedRegEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedRegEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedRegEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedRegEvent != null)
|
||||||
|
{
|
||||||
|
return FailedRegEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/SendTalkEvent.cs
Normal file
57
FunGame.Core/Entity/Event/SendTalkEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class SendTalkEvent : ISendTalkEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeSendTalkEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterSendTalkEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedSendTalkEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedSendTalkEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeSendTalkEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeSendTalkEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeSendTalkEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterSendTalkEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterSendTalkEvent != null)
|
||||||
|
{
|
||||||
|
return AfterSendTalkEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedSendTalkEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedSendTalkEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedSendTalkEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedSendTalkEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedSendTalkEvent != null)
|
||||||
|
{
|
||||||
|
return FailedSendTalkEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/ShowRankingEvent.cs
Normal file
57
FunGame.Core/Entity/Event/ShowRankingEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class ShowRankingEvent : IShowRankingEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeShowRankingEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterShowRankingEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedShowRankingEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedShowRankingEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeShowRankingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeShowRankingEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeShowRankingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterShowRankingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterShowRankingEvent != null)
|
||||||
|
{
|
||||||
|
return AfterShowRankingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedShowRankingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedShowRankingEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedShowRankingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedShowRankingEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedShowRankingEvent != null)
|
||||||
|
{
|
||||||
|
return FailedShowRankingEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/SignInEvent.cs
Normal file
57
FunGame.Core/Entity/Event/SignInEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class SignInEvent : ISignInEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeSignInEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterSignInEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedSignInEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedSignInEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeSignInEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeSignInEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeSignInEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterSignInEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterSignInEvent != null)
|
||||||
|
{
|
||||||
|
return AfterSignInEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedSignInEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedSignInEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedSignInEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedSignInEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedSignInEvent != null)
|
||||||
|
{
|
||||||
|
return FailedSignInEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/StartGameEvent.cs
Normal file
57
FunGame.Core/Entity/Event/StartGameEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class StartGameEvent : IStartGameEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeStartGameEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterStartGameEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedStartGameEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedStartGameEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeStartGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeStartGameEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeStartGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterStartGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterStartGameEvent != null)
|
||||||
|
{
|
||||||
|
return AfterStartGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedStartGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedStartGameEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedStartGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedStartGameEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedStartGameEvent != null)
|
||||||
|
{
|
||||||
|
return FailedStartGameEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/StartMatchEvent.cs
Normal file
57
FunGame.Core/Entity/Event/StartMatchEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class StartMatchEvent : IStartMatchEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeStartMatchEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterStartMatchEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedStartMatchEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedStartMatchEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeStartMatchEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeStartMatchEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeStartMatchEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterStartMatchEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterStartMatchEvent != null)
|
||||||
|
{
|
||||||
|
return AfterStartMatchEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedStartMatchEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedStartMatchEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedStartMatchEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedStartMatchEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedStartMatchEvent != null)
|
||||||
|
{
|
||||||
|
return FailedStartMatchEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
FunGame.Core/Entity/Event/UseItemEvent.cs
Normal file
57
FunGame.Core/Entity/Event/UseItemEvent.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Milimoe.FunGame.Core.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Entity.Event
|
||||||
|
{
|
||||||
|
public class UseItemEvent : IUseItemEvent
|
||||||
|
{
|
||||||
|
public event IEvent.BeforeEvent? BeforeUseItemEvent;
|
||||||
|
public event IEvent.AfterEvent? AfterUseItemEvent;
|
||||||
|
public event IEvent.SucceedEvent? SucceedUseItemEvent;
|
||||||
|
public event IEvent.FailedEvent? FailedUseItemEvent;
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnBeforeUseItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (BeforeUseItemEvent != null)
|
||||||
|
{
|
||||||
|
return BeforeUseItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnAfterUseItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (AfterUseItemEvent != null)
|
||||||
|
{
|
||||||
|
return AfterUseItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnSucceedUseItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (SucceedUseItemEvent != null)
|
||||||
|
{
|
||||||
|
return SucceedUseItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Enum.EventResult OnFailedUseItemEvent(GeneralEventArgs e)
|
||||||
|
{
|
||||||
|
if (FailedUseItemEvent != null)
|
||||||
|
{
|
||||||
|
return FailedUseItemEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enum.EventResult.Fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity.General
|
namespace Milimoe.FunGame.Core.Entity.General
|
||||||
{
|
{
|
||||||
public class Stock
|
public class Inventory
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string Name { get; set; } = "";
|
public string Name { get; set; } = "";
|
@ -24,7 +24,7 @@ namespace Milimoe.FunGame.Core.Entity.General
|
|||||||
public decimal Materials { get; set; } = 0;
|
public decimal Materials { get; set; } = 0;
|
||||||
public decimal GameTime { get; set; } = 0;
|
public decimal GameTime { get; set; } = 0;
|
||||||
public UserStatistics? Statistics { get; set; } = null;
|
public UserStatistics? Statistics { get; set; } = null;
|
||||||
public Stock? Stock { get; set; } = null;
|
public Inventory? Stock { get; set; } = null;
|
||||||
|
|
||||||
internal User()
|
internal User()
|
||||||
{
|
{
|
||||||
|
@ -127,12 +127,12 @@ namespace Milimoe.FunGame.Core.Interface
|
|||||||
public event FailedEvent FailedChangeAccountSettingEvent;
|
public event FailedEvent FailedChangeAccountSettingEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IOpenStockEvent : IEvent
|
public interface IOpenInventoryEvent : IEvent
|
||||||
{
|
{
|
||||||
public event BeforeEvent BeforeOpenStockEvent;
|
public event BeforeEvent BeforeOpenInventoryEvent;
|
||||||
public event AfterEvent AfterOpenStockEvent;
|
public event AfterEvent AfterOpenInventoryEvent;
|
||||||
public event SucceedEvent SucceedOpenStockEvent;
|
public event SucceedEvent SucceedOpenInventoryEvent;
|
||||||
public event FailedEvent FailedOpenStockEvent;
|
public event FailedEvent FailedOpenInventoryEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ISignInEvent : IEvent
|
public interface ISignInEvent : IEvent
|
||||||
|
@ -13,6 +13,7 @@ using Milimoe.FunGame.Core.Entity.Enum;
|
|||||||
using Milimoe.FunGame.Desktop.Others;
|
using Milimoe.FunGame.Desktop.Others;
|
||||||
using Milimoe.FunGame.Desktop.UI;
|
using Milimoe.FunGame.Desktop.UI;
|
||||||
using Milimoe.FunGame.Core.Api.Utility;
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
|
using Milimoe.FunGame.Core.Api.Factory;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Desktop.Utils
|
namespace Milimoe.FunGame.Desktop.Utils
|
||||||
{
|
{
|
||||||
@ -51,7 +52,7 @@ namespace Milimoe.FunGame.Desktop.Utils
|
|||||||
case (int)SocketHelperMethod.Login:
|
case (int)SocketHelperMethod.Login:
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
Send((int)SocketMessageType.CheckLogin, new object[] { Main, client, new User("Mili") });
|
Send((int)SocketMessageType.CheckLogin, new object[] { Main, client, UserFactory.GetInstance("Mili") });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user