-
Notifications
You must be signed in to change notification settings - Fork 6
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
0 parents
commit 386cdd7
Showing
92 changed files
with
7,889 additions
and
0 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,8 @@ | ||
.idea | ||
.vs | ||
_ReSharper* | ||
|
||
/packages | ||
|
||
[Bb]in/ | ||
[Oo]bj/ |
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; | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
using KGSE.Entities.Internal; | ||
using KGSE.Entities.Internal.Known; | ||
|
||
namespace KGSE.Entities { | ||
public sealed class Answers : BooleanPropertyBag { | ||
|
||
internal Answers([NotNull] KkCharacter character) { | ||
_character = character; | ||
LikesAnimals = CreateProperty(KnownAnswerKeys.Animal); | ||
LikesEating = CreateProperty(KnownAnswerKeys.Eat); | ||
CooksByHerself = CreateProperty(KnownAnswerKeys.Cook); | ||
LikesExercising = CreateProperty(KnownAnswerKeys.Exercise); | ||
StudiesHard = CreateProperty(KnownAnswerKeys.Study); | ||
Chic = CreateProperty(KnownAnswerKeys.Fashionable); | ||
AcceptsBlackCoffee = CreateProperty(KnownAnswerKeys.BlackCoffee); | ||
LikesSpicyFood = CreateProperty(KnownAnswerKeys.Spicy); | ||
LikesSweetFood = CreateProperty(KnownAnswerKeys.Sweet); | ||
|
||
RegisterEventHandlers(); | ||
} | ||
|
||
~Answers() { | ||
UnregisterEventHandlers(); | ||
} | ||
|
||
[NotNull] | ||
public BooleanProperty LikesAnimals { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty LikesEating { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty CooksByHerself { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty LikesExercising { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty StudiesHard { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty Chic { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty AcceptsBlackCoffee { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty LikesSpicyFood { get; } | ||
|
||
[NotNull] | ||
public BooleanProperty LikesSweetFood { get; } | ||
|
||
public override ValueProperty<bool>[] GetAllProperties() { | ||
return new ValueProperty<bool>[] { | ||
LikesAnimals, | ||
LikesEating, | ||
CooksByHerself, | ||
LikesExercising, | ||
StudiesHard, | ||
Chic, | ||
AcceptsBlackCoffee, | ||
LikesSpicyFood, | ||
LikesSweetFood, | ||
}; | ||
} | ||
|
||
private void RegisterEventHandlers() { | ||
var properties = GetAllProperties(); | ||
|
||
foreach (var property in properties) { | ||
property.ValueChanged += OnValueChanged; | ||
} | ||
} | ||
|
||
private void UnregisterEventHandlers() { | ||
var properties = GetAllProperties(); | ||
|
||
foreach (var property in properties) { | ||
property.ValueChanged -= OnValueChanged; | ||
} | ||
} | ||
|
||
private void OnValueChanged(object sender, EventArgs e) { | ||
var s = (BooleanProperty)sender; | ||
_character.SetAnswer(s.Key, s.Value); | ||
} | ||
|
||
[NotNull] | ||
private BooleanProperty CreateProperty([NotNull] string key) { | ||
var v = _character.GetAnswer(key); | ||
|
||
Debug.Assert(v != null, nameof(v) + " != null"); | ||
return new BooleanProperty(key, v.Value); | ||
} | ||
|
||
[NotNull] | ||
private readonly KkCharacter _character; | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
KoikatuGameSaveEditor.Entities/Entities/BooleanProperty.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,13 @@ | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
|
||
namespace KGSE.Entities { | ||
[DebuggerDisplay("Boolean Property: [\"{Key}\" = {Value}]")] | ||
public sealed class BooleanProperty : ValueProperty<bool> { | ||
|
||
internal BooleanProperty([NotNull] string key, bool value) | ||
: base(key, value) { | ||
} | ||
|
||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
KoikatuGameSaveEditor.Entities/Entities/BooleanPropertyBag.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,8 @@ | ||
namespace KGSE.Entities { | ||
public abstract class BooleanPropertyBag : ValuePropertyBag<bool> { | ||
|
||
private protected BooleanPropertyBag() { | ||
} | ||
|
||
} | ||
} |
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,47 @@ | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
using KGSE.Entities.Internal; | ||
|
||
namespace KGSE.Entities { | ||
[DebuggerDisplay("Character: {LastName} {FirstName}")] | ||
public abstract class CharacterBase { | ||
|
||
private protected CharacterBase([NotNull] KkCharacter character) { | ||
InternalCharacter = character; | ||
} | ||
|
||
public abstract Gender Gender { get; } | ||
|
||
[NotNull] | ||
public string FirstName { | ||
get => InternalCharacter.FirstName; | ||
set => InternalCharacter.FirstName = value; | ||
} | ||
|
||
[NotNull] | ||
public string LastName { | ||
get => InternalCharacter.LastName; | ||
set => InternalCharacter.LastName = value; | ||
} | ||
|
||
[NotNull] | ||
public string Nickname { | ||
get => InternalCharacter.Nickname; | ||
set => InternalCharacter.Nickname = value; | ||
} | ||
|
||
[CanBeNull] | ||
public byte[] GetPrimaryCardImageData() { | ||
return (byte[])InternalCharacter.PrimaryCardImageData?.Clone(); | ||
} | ||
|
||
[NotNull] | ||
public byte[] GetSecondaryCardImageData() { | ||
return (byte[])InternalCharacter.SecondaryCardImageData.Clone(); | ||
} | ||
|
||
[NotNull] | ||
internal KkCharacter InternalCharacter { get; } | ||
|
||
} | ||
} |
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,99 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
using KGSE.Entities.Internal; | ||
using KGSE.Entities.Internal.Known; | ||
|
||
namespace KGSE.Entities { | ||
public sealed class Development : PercentagePropertyBag { | ||
|
||
internal Development([NotNull] KkCharacter character) { | ||
_character = character; | ||
Breasts = CreateProperty(KnownPercentageKeys.Mune); | ||
Crotch = CreateProperty(KnownPercentageKeys.Kokan); | ||
Anal = CreateProperty(KnownPercentageKeys.Anal); | ||
Butts = CreateProperty(KnownPercentageKeys.Siri); | ||
Nipples = CreateProperty(KnownPercentageKeys.Tikubi); | ||
VaginaInsertion = CreateProperty(KnownPercentageKeys.KokanPiston); | ||
AnalInsertion = CreateProperty(KnownPercentageKeys.AnalPiston); | ||
Serving = CreateProperty(KnownPercentageKeys.Houshi); | ||
|
||
RegisterEventHandlers(); | ||
} | ||
|
||
~Development() { | ||
UnregisterEventHandlers(); | ||
} | ||
|
||
[NotNull] | ||
public PercentageProperty Breasts { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty Crotch { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty Anal { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty Butts { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty Nipples { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty VaginaInsertion { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty AnalInsertion { get; } | ||
|
||
[NotNull] | ||
public PercentageProperty Serving { get; } | ||
|
||
public override ValueProperty<Percentage>[] GetAllProperties() { | ||
return new ValueProperty<Percentage>[] { | ||
Breasts, | ||
Crotch, | ||
Anal, | ||
Butts, | ||
Nipples, | ||
VaginaInsertion, | ||
AnalInsertion, | ||
Serving, | ||
}; | ||
} | ||
|
||
private void RegisterEventHandlers() { | ||
var properties = GetAllProperties(); | ||
|
||
foreach (var property in properties) { | ||
property.ValueChanged += OnValueChanged; | ||
} | ||
} | ||
|
||
private void UnregisterEventHandlers() { | ||
var properties = GetAllProperties(); | ||
|
||
foreach (var property in properties) { | ||
property.ValueChanged -= OnValueChanged; | ||
} | ||
} | ||
|
||
private void OnValueChanged(object sender, EventArgs e) { | ||
var s = (PercentageProperty)sender; | ||
Trace.Assert(Percentage.P0 <= s.Value && s.Value <= Percentage.P100); | ||
_character.SetPercentage(s.Key, (int)s.Value); | ||
} | ||
|
||
[NotNull] | ||
private PercentageProperty CreateProperty([NotNull] string key) { | ||
var v = _character.GetPercentage(key); | ||
|
||
Debug.Assert(v != null, nameof(v) + " != null"); | ||
return new PercentageProperty(key, (Percentage)v.Value); | ||
} | ||
|
||
[NotNull] | ||
private readonly KkCharacter _character; | ||
|
||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
KoikatuGameSaveEditor.Entities/Entities/FemaleCharacter.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,82 @@ | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
using KGSE.Entities.Internal; | ||
|
||
namespace KGSE.Entities { | ||
[DebuggerDisplay("Female Character: {LastName} {FirstName}")] | ||
public sealed class FemaleCharacter : CharacterBase { | ||
|
||
internal FemaleCharacter([NotNull] KkCharacter character) | ||
: base(character) { | ||
Answers = new Answers(character); | ||
IntercoursePreferences = new IntercoursePreference(character); | ||
Traits = new Traits(character); | ||
Development = new Development(character); | ||
} | ||
|
||
public override Gender Gender => Gender.Female; | ||
|
||
public Personality Personality { | ||
get => (Personality)InternalCharacter.Personality; | ||
set => InternalCharacter.Personality = (int)value; | ||
} | ||
|
||
public WeakPoint WeakPoint { | ||
get => (WeakPoint)InternalCharacter.WeakPoint; | ||
set => InternalCharacter.WeakPoint = (int)value; | ||
} | ||
|
||
[NotNull] | ||
public Answers Answers { get; } | ||
|
||
[NotNull] | ||
public IntercoursePreference IntercoursePreferences { get; } | ||
|
||
[NotNull] | ||
public Traits Traits { get; } | ||
|
||
public int Feeling { | ||
get => InternalCharacter.Feeling ?? 0; | ||
set => InternalCharacter.Feeling = value; | ||
} | ||
|
||
public bool IsLover { | ||
get => InternalCharacter.IsLover ?? false; | ||
set => InternalCharacter.IsLover = value; | ||
} | ||
|
||
public int EroticDegree { | ||
get => InternalCharacter.LoveGauge ?? 0; | ||
set => InternalCharacter.LoveGauge = value; | ||
} | ||
|
||
public int IntercourseCount { | ||
get => InternalCharacter.HCount ?? 0; | ||
set => InternalCharacter.HCount = value; | ||
} | ||
|
||
public int Intimacy { | ||
get => InternalCharacter.Intimacy ?? 0; | ||
set => InternalCharacter.Intimacy = value; | ||
} | ||
|
||
public bool IsAngry { | ||
get => InternalCharacter.IsAngry ?? false; | ||
set => InternalCharacter.IsAngry = value; | ||
} | ||
|
||
public bool IsClubMember { | ||
get => InternalCharacter.IsClubMember ?? false; | ||
set => InternalCharacter.IsClubMember = value; | ||
} | ||
|
||
public bool HasDate { | ||
get => InternalCharacter.HasDate ?? false; | ||
set => InternalCharacter.HasDate = value; | ||
} | ||
|
||
[NotNull] | ||
public Development Development { get; } | ||
|
||
} | ||
} |
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 KGSE.Entities { | ||
public enum Gender { | ||
|
||
Male = 0, | ||
Female = 1, | ||
|
||
} | ||
} |
Oops, something went wrong.