From 021771488e6547100820eae5edc79902488ac6de Mon Sep 17 00:00:00 2001 From: Seweryn Presnal Date: Sun, 7 Nov 2021 01:10:58 +0100 Subject: [PATCH] Encapsulate fields of Imperator.Characters.PaletteCoordinates (#372) #patch --- .../Imperator/Characters/CharacterTests.cs | 12 +++---- .../Imperator/Characters/PortraitDataTests.cs | 36 +++++++++---------- .../Characters/PaletteCoordinates.cs | 5 +-- .../Imperator/Characters/PortraitData.cs | 12 +++---- .../Outputter/CharacterOutputter.cs | 6 ++-- 5 files changed, 37 insertions(+), 34 deletions(-) diff --git a/ImperatorToCK3.UnitTests/Imperator/Characters/CharacterTests.cs b/ImperatorToCK3.UnitTests/Imperator/Characters/CharacterTests.cs index 863639b57..125c8a4a7 100644 --- a/ImperatorToCK3.UnitTests/Imperator/Characters/CharacterTests.cs +++ b/ImperatorToCK3.UnitTests/Imperator/Characters/CharacterTests.cs @@ -168,12 +168,12 @@ public void ColorPaletteCoordinatesCanBeExtractedFromDNA() { var character = ImperatorToCK3.Imperator.Characters.Character.Parse(reader, "42", genesDB); Assert.NotNull(character.PortraitData); - Assert.Equal((uint)0, character.PortraitData.HairColorPaletteCoordinates.x); - Assert.Equal((uint)0, character.PortraitData.HairColorPaletteCoordinates.y); - Assert.Equal((uint)0, character.PortraitData.SkinColorPaletteCoordinates.x); - Assert.Equal((uint)0, character.PortraitData.SkinColorPaletteCoordinates.y); - Assert.Equal((uint)0, character.PortraitData.EyeColorPaletteCoordinates.x); - Assert.Equal((uint)0, character.PortraitData.EyeColorPaletteCoordinates.y); + Assert.Equal((uint)0, character.PortraitData.HairColorPaletteCoordinates.X); + Assert.Equal((uint)0, character.PortraitData.HairColorPaletteCoordinates.Y); + Assert.Equal((uint)0, character.PortraitData.SkinColorPaletteCoordinates.X); + Assert.Equal((uint)0, character.PortraitData.SkinColorPaletteCoordinates.Y); + Assert.Equal((uint)0, character.PortraitData.EyeColorPaletteCoordinates.X); + Assert.Equal((uint)0, character.PortraitData.EyeColorPaletteCoordinates.Y); } [Fact] diff --git a/ImperatorToCK3.UnitTests/Imperator/Characters/PortraitDataTests.cs b/ImperatorToCK3.UnitTests/Imperator/Characters/PortraitDataTests.cs index a75ef0ab0..1ae3b967e 100644 --- a/ImperatorToCK3.UnitTests/Imperator/Characters/PortraitDataTests.cs +++ b/ImperatorToCK3.UnitTests/Imperator/Characters/PortraitDataTests.cs @@ -7,14 +7,14 @@ public void HairColorXCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.HairColorPaletteCoordinates.x); + Assert.Equal((uint)0, testPortraitData.HairColorPaletteCoordinates.X); } [Fact] public void HairColorXCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("/wAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.HairColorPaletteCoordinates.x); + Assert.Equal((uint)510, testPortraitData.HairColorPaletteCoordinates.X); } [Fact] @@ -22,7 +22,7 @@ public void HairColorXCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("ZAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.HairColorPaletteCoordinates.x); + Assert.Equal((uint)200, testPortraitData.HairColorPaletteCoordinates.X); } [Fact] @@ -30,7 +30,7 @@ public void HairColorYCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.HairColorPaletteCoordinates.y); + Assert.Equal((uint)0, testPortraitData.HairColorPaletteCoordinates.Y); } [Fact] @@ -38,7 +38,7 @@ public void HairColorYCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AP8AAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.HairColorPaletteCoordinates.y); + Assert.Equal((uint)510, testPortraitData.HairColorPaletteCoordinates.Y); } [Fact] @@ -46,7 +46,7 @@ public void HairColorYCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AGQAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.HairColorPaletteCoordinates.y); + Assert.Equal((uint)200, testPortraitData.HairColorPaletteCoordinates.Y); } [Fact] @@ -54,7 +54,7 @@ public void SkinColorXCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.SkinColorPaletteCoordinates.x); + Assert.Equal((uint)0, testPortraitData.SkinColorPaletteCoordinates.X); } [Fact] @@ -62,7 +62,7 @@ public void SkinColorXCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAP8AAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.SkinColorPaletteCoordinates.x); + Assert.Equal((uint)510, testPortraitData.SkinColorPaletteCoordinates.X); } [Fact] @@ -70,7 +70,7 @@ public void SkinColorXCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAGQAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.SkinColorPaletteCoordinates.x); + Assert.Equal((uint)200, testPortraitData.SkinColorPaletteCoordinates.X); } [Fact] @@ -78,7 +78,7 @@ public void SkinColorYCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.SkinColorPaletteCoordinates.y); + Assert.Equal((uint)0, testPortraitData.SkinColorPaletteCoordinates.Y); } [Fact] @@ -86,7 +86,7 @@ public void SkinColorYCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAD/AAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.SkinColorPaletteCoordinates.y); + Assert.Equal((uint)510, testPortraitData.SkinColorPaletteCoordinates.Y); } [Fact] @@ -94,7 +94,7 @@ public void SkinColorYCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAABkAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.SkinColorPaletteCoordinates.y); + Assert.Equal((uint)200, testPortraitData.SkinColorPaletteCoordinates.Y); } [Fact] @@ -102,7 +102,7 @@ public void EyeColorXCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.EyeColorPaletteCoordinates.x); + Assert.Equal((uint)0, testPortraitData.EyeColorPaletteCoordinates.X); } [Fact] @@ -110,7 +110,7 @@ public void EyeColorXCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAD/AAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.EyeColorPaletteCoordinates.x); + Assert.Equal((uint)510, testPortraitData.EyeColorPaletteCoordinates.X); } [Fact] @@ -118,7 +118,7 @@ public void EyeColorXCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAABkAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.EyeColorPaletteCoordinates.x); + Assert.Equal((uint)200, testPortraitData.EyeColorPaletteCoordinates.X); } [Fact] @@ -126,7 +126,7 @@ public void EyeColorYCanBeSetToZero() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAAAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)0, testPortraitData.EyeColorPaletteCoordinates.y); + Assert.Equal((uint)0, testPortraitData.EyeColorPaletteCoordinates.Y); } [Fact] @@ -134,7 +134,7 @@ public void EyeColorYCanBeSetToMax() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAA/wAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)510, testPortraitData.EyeColorPaletteCoordinates.y); + Assert.Equal((uint)510, testPortraitData.EyeColorPaletteCoordinates.Y); } [Fact] @@ -142,7 +142,7 @@ public void EyeColorYCanBeSetToArbitraryValue() { var genesDB = new ImperatorToCK3.Imperator.Genes.GenesDB(); var testPortraitData = new ImperatorToCK3.Imperator.Characters.PortraitData("AAAAAAAAAAAAZAAAAH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AfwB/AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", genesDB); - Assert.Equal((uint)200, testPortraitData.EyeColorPaletteCoordinates.y); + Assert.Equal((uint)200, testPortraitData.EyeColorPaletteCoordinates.Y); } } } diff --git a/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs b/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs index c1f4eeb0e..ec7556d73 100644 --- a/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs +++ b/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs @@ -1,6 +1,7 @@ namespace ImperatorToCK3.Imperator.Characters { public class PaletteCoordinates { - public uint x = 256; // palettes are 512x512 - public uint y = 256; + // palettes are 512x512 + public uint X { get; set; } = 256; + public uint Y { get; set; } = 256; } } diff --git a/ImperatorToCK3/Imperator/Characters/PortraitData.cs b/ImperatorToCK3/Imperator/Characters/PortraitData.cs index 4f2f5a670..32bb5dbe4 100644 --- a/ImperatorToCK3/Imperator/Characters/PortraitData.cs +++ b/ImperatorToCK3/Imperator/Characters/PortraitData.cs @@ -22,14 +22,14 @@ public PortraitData(string dnaString, Genes.GenesDB genesDB, string ageSexString const int eyeColorPaletteYIndex = 9; // hair - HairColorPaletteCoordinates.x = (uint)decodedDnaStr[hairColorPaletteXIndex] * 2; - HairColorPaletteCoordinates.y = (uint)decodedDnaStr[hairColorPaletteYIndex] * 2; + HairColorPaletteCoordinates.X = (uint)decodedDnaStr[hairColorPaletteXIndex] * 2; + HairColorPaletteCoordinates.Y = (uint)decodedDnaStr[hairColorPaletteYIndex] * 2; // skin - SkinColorPaletteCoordinates.x = (uint)decodedDnaStr[skinColorPaletteXIndex] * 2; - SkinColorPaletteCoordinates.y = (uint)decodedDnaStr[skinColorPaletteYIndex] * 2; + SkinColorPaletteCoordinates.X = (uint)decodedDnaStr[skinColorPaletteXIndex] * 2; + SkinColorPaletteCoordinates.Y = (uint)decodedDnaStr[skinColorPaletteYIndex] * 2; // eyes - EyeColorPaletteCoordinates.x = (uint)decodedDnaStr[eyeColorPaletteXIndex] * 2; - EyeColorPaletteCoordinates.y = (uint)decodedDnaStr[eyeColorPaletteYIndex] * 2; + EyeColorPaletteCoordinates.X = (uint)decodedDnaStr[eyeColorPaletteXIndex] * 2; + EyeColorPaletteCoordinates.Y = (uint)decodedDnaStr[eyeColorPaletteYIndex] * 2; // accessory genes const uint colorGenesBytes = 12; diff --git a/ImperatorToCK3/Outputter/CharacterOutputter.cs b/ImperatorToCK3/Outputter/CharacterOutputter.cs index 42a99c021..fe744fc92 100644 --- a/ImperatorToCK3/Outputter/CharacterOutputter.cs +++ b/ImperatorToCK3/Outputter/CharacterOutputter.cs @@ -26,10 +26,12 @@ public static void OutputCharacter(StreamWriter output, Character character, Dat } //output father and mother - if (character.Father is not null) + if (character.Father is not null) { output.WriteLine($"\tfather = {character.Father.Id}"); - if (character.Mother is not null) + } + if (character.Mother is not null) { output.WriteLine($"\tmother = {character.Mother.Id}"); + } // output spouse // TODO: output add_spouse with earlier date if the pair has a born or unborn child