Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from ethanmoffat/quest_history_progress
Implement quest history/progress dialog and player session exp dialog
- Loading branch information
Showing
38 changed files
with
1,060 additions
and
778 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace EOLib.Domain.Interact.Quest | ||
{ | ||
public enum BookIcon : byte | ||
{ | ||
Item = 3, | ||
Talk = 5, | ||
Kill = 8, | ||
Step = 10 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace EOLib.Domain.Interact.Quest | ||
{ | ||
public enum QuestPage | ||
{ | ||
Progress = 1, | ||
History | ||
} | ||
} |
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,103 @@ | ||
using System; | ||
|
||
namespace EOLib.Domain.Interact.Quest | ||
{ | ||
public class QuestProgressData : IQuestProgressData | ||
{ | ||
public string Name { get; private set; } | ||
|
||
public string Description { get; private set; } | ||
|
||
public BookIcon Icon { get; private set; } | ||
|
||
public int IconIndex | ||
{ | ||
get | ||
{ | ||
//these are probably wrong. can't really tell what it's supposed to be from original | ||
switch (Icon) | ||
{ | ||
case BookIcon.Item: | ||
return 2; | ||
case BookIcon.Talk: | ||
return 1; | ||
case BookIcon.Kill: | ||
return 3; | ||
case BookIcon.Step: | ||
return 4; | ||
default: | ||
throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
} | ||
|
||
public short Progress { get; private set; } | ||
|
||
public short Target { get; private set; } | ||
|
||
public QuestProgressData() { } | ||
|
||
private QuestProgressData(string name, | ||
string description, | ||
BookIcon icon, | ||
short progress, | ||
short target) | ||
{ | ||
Name = name; | ||
Description = description; | ||
Icon = icon; | ||
Progress = progress; | ||
Target = target; | ||
} | ||
|
||
public IQuestProgressData WithName(string name) | ||
{ | ||
return new QuestProgressData(name, Description, Icon, Progress, Target); | ||
} | ||
|
||
public IQuestProgressData WithDescription(string description) | ||
{ | ||
return new QuestProgressData(Name, description, Icon, Progress, Target); | ||
} | ||
|
||
public IQuestProgressData WithIcon(BookIcon icon) | ||
{ | ||
return new QuestProgressData(Name, Description, icon, Progress, Target); | ||
} | ||
|
||
public IQuestProgressData WithProgress(short progress) | ||
{ | ||
return new QuestProgressData(Name, Description, Icon, progress, Target); | ||
} | ||
|
||
public IQuestProgressData WithTarget(short target) | ||
{ | ||
return new QuestProgressData(Name, Description, Icon, Progress, target); | ||
} | ||
} | ||
|
||
public interface IQuestProgressData | ||
{ | ||
string Name { get; } | ||
|
||
string Description { get; } | ||
|
||
BookIcon Icon { get; } | ||
|
||
int IconIndex { get; } | ||
|
||
short Progress { get; } | ||
|
||
short Target { get; } | ||
|
||
IQuestProgressData WithName(string name); | ||
|
||
IQuestProgressData WithDescription(string description); | ||
|
||
IQuestProgressData WithIcon(BookIcon icon); | ||
|
||
IQuestProgressData WithProgress(short progress); | ||
|
||
IQuestProgressData WithTarget(short target); | ||
} | ||
} |
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
Oops, something went wrong.