Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5baee0d
commit 750ba3e
Showing
14 changed files
with
277 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using AutomaticTypeMapper; | ||
using System; | ||
|
||
namespace EOLib.Domain.Character | ||
{ | ||
public interface ICharacterSessionRepository : IResettable | ||
{ | ||
DateTime SessionStartTime { get; set; } | ||
|
||
int BestKillExp { get; set; } | ||
|
||
int LastKillExp { get; set; } | ||
|
||
int TodayTotalExp { get; set; } | ||
} | ||
|
||
public interface ICharacterSessionProvider : IResettable | ||
{ | ||
DateTime SessionStartTime { get; } | ||
|
||
int BestKillExp { get; } | ||
|
||
int LastKillExp { get; } | ||
|
||
int TodayTotalExp { get; } | ||
} | ||
|
||
[AutoMappedType(IsSingleton = true)] | ||
public class CharacterSessionRepository : ICharacterSessionRepository, ICharacterSessionProvider | ||
{ | ||
public DateTime SessionStartTime { get; set; } | ||
|
||
public int BestKillExp { get; set; } | ||
|
||
public int LastKillExp { get; set; } | ||
|
||
public int TodayTotalExp { get; set; } | ||
|
||
public CharacterSessionRepository() | ||
{ | ||
ResetState(); | ||
} | ||
|
||
public void ResetState() | ||
{ | ||
SessionStartTime = DateTime.Now; | ||
BestKillExp = 0; | ||
LastKillExp = 0; | ||
TodayTotalExp = 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,6 @@ public enum CharacterStat | |
Charisma, | ||
|
||
Weight, | ||
MaxWeight | ||
MaxWeight, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
EndlessClient/Dialogs/Factories/SessionExpDialogFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using AutomaticTypeMapper; | ||
using EndlessClient.Dialogs.Services; | ||
using EOLib.Domain.Character; | ||
using EOLib.Graphics; | ||
using EOLib.Localization; | ||
|
||
namespace EndlessClient.Dialogs.Factories | ||
{ | ||
[AutoMappedType] | ||
public class SessionExpDialogFactory : ISessionExpDialogFactory | ||
{ | ||
private readonly INativeGraphicsManager _nativeGraphicsManager; | ||
private readonly IEODialogButtonService _dialogButtonService; | ||
private readonly ILocalizedStringFinder _localizedStringFinder; | ||
private readonly ICharacterProvider _characterProvider; | ||
private readonly IExperienceTableProvider _expTableProvider; | ||
private readonly ICharacterSessionProvider _characterSessionProvider; | ||
|
||
public SessionExpDialogFactory(INativeGraphicsManager nativeGraphicsManager, | ||
IEODialogButtonService dialogButtonService, | ||
ILocalizedStringFinder localizedStringFinder, | ||
ICharacterProvider characterProvider, | ||
IExperienceTableProvider expTableProvider, | ||
ICharacterSessionProvider characterSessionProvider) | ||
{ | ||
_nativeGraphicsManager = nativeGraphicsManager; | ||
_dialogButtonService = dialogButtonService; | ||
_localizedStringFinder = localizedStringFinder; | ||
_characterProvider = characterProvider; | ||
_expTableProvider = expTableProvider; | ||
_characterSessionProvider = characterSessionProvider; | ||
} | ||
|
||
public SessionExpDialog Create() | ||
{ | ||
return new SessionExpDialog(_nativeGraphicsManager, | ||
_dialogButtonService, | ||
_localizedStringFinder, | ||
_characterProvider, | ||
_expTableProvider, | ||
_characterSessionProvider); | ||
} | ||
} | ||
|
||
public interface ISessionExpDialogFactory | ||
{ | ||
SessionExpDialog Create(); | ||
} | ||
} |
Oops, something went wrong.