mirror of
https://github.com/kwsch/NHSE.git
synced 2026-07-19 00:31:38 -05:00
Convert OutsideAcreList to enum
This commit is contained in:
parent
9523376a9c
commit
fd81b2cb61
165
NHSE.Core/Structures/Acres/OutsideAcre.cs
Normal file
165
NHSE.Core/Structures/Acres/OutsideAcre.cs
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
namespace NHSE.Core
|
||||
{
|
||||
public enum OutsideAcre : ushort
|
||||
{
|
||||
Flat = 00,
|
||||
|
||||
FldOutNShip00 = 16,
|
||||
|
||||
FldOutW00 = 20,
|
||||
FldOutW01 = 21,
|
||||
FldOutW02 = 22,
|
||||
FldOutW03 = 23,
|
||||
|
||||
FldOutWRiver00 = 27,
|
||||
|
||||
FldOutE00 = 29,
|
||||
FldOutE01 = 30,
|
||||
FldOutE02 = 31,
|
||||
FldOutE03 = 32,
|
||||
|
||||
FldOutSW00 = 38,
|
||||
FldOutS00 = 39,
|
||||
FldOutSRiver00 = 40,
|
||||
FldOutSAirPortLeft00 = 41,
|
||||
FldOutSE00 = 42,
|
||||
FldOutSeaN00 = 43,
|
||||
FldOutSeaNW00 = 44,
|
||||
FldOutSeaNE00 = 45,
|
||||
FldOutSeaW00 = 46,
|
||||
|
||||
FldOutSeaE00 = 48,
|
||||
|
||||
FldOutSeaSW00 = 50,
|
||||
FldOutSeaS00 = 51,
|
||||
FldOutSeaSE00 = 52,
|
||||
|
||||
FldOutE04 = 62,
|
||||
|
||||
FldOutERiver00 = 91,
|
||||
FldOutSW01 = 92,
|
||||
FldOutSAirPortRight00 = 93,
|
||||
|
||||
FldOutS01 = 97,
|
||||
FldOutSE01 = 98,
|
||||
FldOutSE03 = 99,
|
||||
FldOutSE02 = 100,
|
||||
FldOutSW03 = 101,
|
||||
FldOutSW02 = 102,
|
||||
FldOutS03 = 103,
|
||||
FldOutS02 = 104,
|
||||
FldOutS04 = 105,
|
||||
FldOutNEStone00 = 106,
|
||||
FldOutNStone03 = 107,
|
||||
FldOutNStone02 = 108,
|
||||
FldOutNStone01 = 109,
|
||||
FldOutNStoneR00 = 110,
|
||||
FldOutNStoneL00 = 111,
|
||||
FldOutNStone00 = 112,
|
||||
FldOutNStone04 = 113,
|
||||
|
||||
FldOutEIslandDown01 = 115,
|
||||
FldOutEIslandDown00 = 116,
|
||||
FldOutEIslandUp00 = 117,
|
||||
FldOutEIslandUp01 = 118,
|
||||
FldOutWStone01 = 119,
|
||||
FldOutWStone00 = 120,
|
||||
FldOutEStone00 = 121,
|
||||
FldOutEStone01 = 122,
|
||||
FldOutNEStone01 = 123,
|
||||
FldOutNWStone01 = 124,
|
||||
FldOutNWStone00 = 125,
|
||||
FldOutWCliff00 = 126,
|
||||
FldOutW04 = 127,
|
||||
FldOutNShip02 = 128,
|
||||
FldOutNShip01 = 129,
|
||||
|
||||
FldOutWCliff01 = 131,
|
||||
FldOutSRiver01 = 132,
|
||||
FldOutWRiver01 = 133,
|
||||
FldOutERiver01 = 134,
|
||||
FldOutSWBridge01 = 135,
|
||||
FldOutSWBridge00 = 136,
|
||||
FldOutSEBridge01 = 137,
|
||||
FldOutSEBridge00 = 138,
|
||||
FldOutECliff01 = 139,
|
||||
FldOutECliff00 = 140,
|
||||
FldOutWIslandDown00 = 141,
|
||||
FldOutWIslandDown01 = 142,
|
||||
FldOutWIslandUp00 = 143,
|
||||
FldOutWIslandUp01 = 144,
|
||||
FldOutEStone02 = 145,
|
||||
FldOutWStone02 = 146,
|
||||
FldOutSeaN02 = 147,
|
||||
FldOutSeaN01 = 148,
|
||||
|
||||
FldOutSeaW02 = 151,
|
||||
FldOutSeaW01 = 152,
|
||||
|
||||
FldOutSeaS02 = 155,
|
||||
FldOutSeaS01 = 156,
|
||||
FldOutSeaSW02 = 157,
|
||||
FldOutSeaSW01 = 158,
|
||||
FldOutSeaNW02 = 159,
|
||||
FldOutSeaNW01 = 160,
|
||||
FldOutSeaN05 = 161,
|
||||
FldOutSeaN04 = 162,
|
||||
FldOutSeaN03 = 163,
|
||||
FldOutSeaN08 = 164,
|
||||
FldOutSeaN07 = 165,
|
||||
FldOutSeaN06 = 166,
|
||||
|
||||
FldOutSeaNW03 = 172,
|
||||
FldOutSeaW08 = 173,
|
||||
FldOutSeaW07 = 174,
|
||||
FldOutSeaW06 = 175,
|
||||
FldOutSeaW04 = 176,
|
||||
FldOutSeaW05 = 177,
|
||||
FldOutSeaW03 = 178,
|
||||
|
||||
FldOutSeaSW03 = 184,
|
||||
|
||||
FldOutSeaS05 = 191,
|
||||
FldOutSeaS04 = 192,
|
||||
FldOutSeaS03 = 193,
|
||||
FldOutSeaS08 = 194,
|
||||
FldOutSeaS07 = 195,
|
||||
FldOutSeaS06 = 196,
|
||||
FldOutSeaSE02 = 197,
|
||||
FldOutSeaSE01 = 198,
|
||||
|
||||
FldOutSeaSE03 = 200,
|
||||
|
||||
FldOutSeaE05 = 205,
|
||||
FldOutSeaE04 = 206,
|
||||
FldOutSeaE03 = 207,
|
||||
FldOutSeaE01 = 208,
|
||||
FldOutSeaE02 = 209,
|
||||
FldOutSeaE08 = 210,
|
||||
FldOutSeaE06 = 211,
|
||||
FldOutSeaE07 = 212,
|
||||
|
||||
FldOutSeaNE03 = 216,
|
||||
FldOutSeaNE01 = 219,
|
||||
FldOutSeaNE02 = 220,
|
||||
|
||||
FldOutSBridge00 = 222,
|
||||
FldOutWIslandDown02 = 223,
|
||||
FldOutWIslandUp02 = 224,
|
||||
FldOutEIslandDown02 = 225,
|
||||
FldOutEIslandUp02 = 226,
|
||||
FldOutECliff02 = 227,
|
||||
FldOutWCliff02 = 228,
|
||||
FldOutNEStone02 = 229,
|
||||
FldOutNWStone02 = 230,
|
||||
FldOutEStone03 = 231,
|
||||
FldOutWStone03 = 232,
|
||||
FldOutSRiver02 = 233,
|
||||
|
||||
FldOutPhotoSBridge00 = 240,
|
||||
FldOutPhotoSE00 = 241,
|
||||
FldOutPhotoSW00 = 242,
|
||||
FldOutSBridge02 = 243,
|
||||
FldOutSBridge01 = 244
|
||||
}
|
||||
}
|
||||
|
|
@ -1,151 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace NHSE.Core
|
||||
{
|
||||
public static class OutsideAcreList
|
||||
{
|
||||
public static string GetName(ushort acre) => Names.TryGetValue(acre, out var name) ? name : "???";
|
||||
|
||||
public static readonly IReadOnlyDictionary<ushort, string> Names = new Dictionary<ushort, string>
|
||||
{
|
||||
{0x00, "Flat"}, // 00
|
||||
|
||||
{0x10, "FldOutNShip00"}, // 16
|
||||
{0x14, "FldOutW00"}, // 20
|
||||
{0x15, "FldOutW01"}, // 21
|
||||
{0x16, "FldOutW02"}, // 22
|
||||
{0x17, "FldOutW03"}, // 23
|
||||
{0x1B, "FldOutWRiver00"}, // 27
|
||||
{0x1D, "FldOutE00"}, // 29
|
||||
{0x1E, "FldOutE01"}, // 30
|
||||
{0x1F, "FldOutE02"}, // 31
|
||||
{0x20, "FldOutE03"}, // 32
|
||||
{0x26, "FldOutSW00"}, // 38
|
||||
{0x27, "FldOutS00"}, // 39
|
||||
{0x28, "FldOutSRiver00"}, // 40
|
||||
{0x29, "FldOutSAirPortLeft00"}, // 41
|
||||
{0x2A, "FldOutSE00"}, // 42
|
||||
{0x2B, "FldOutSeaN00"}, // 43
|
||||
{0x2C, "FldOutSeaNW00"}, // 44
|
||||
{0x2D, "FldOutSeaNE00"}, // 45
|
||||
{0x2E, "FldOutSeaW00"}, // 46
|
||||
{0x30, "FldOutSeaE00"}, // 48
|
||||
{0x32, "FldOutSeaSW00"}, // 50
|
||||
{0x33, "FldOutSeaS00"}, // 51
|
||||
{0x34, "FldOutSeaSE00"}, // 52
|
||||
{0x3E, "FldOutE04"}, // 62
|
||||
{0x5B, "FldOutERiver00"}, // 91
|
||||
{0x5C, "FldOutSW01"}, // 92
|
||||
{0x5D, "FldOutSAirPortRight00"}, // 93
|
||||
{0x61, "FldOutS01"}, // 97
|
||||
{0x62, "FldOutSE01"}, // 98
|
||||
{0x63, "FldOutSE03"}, // 99
|
||||
{0x64, "FldOutSE02"}, // 100
|
||||
{0x65, "FldOutSW03"}, // 101
|
||||
{0x66, "FldOutSW02"}, // 102
|
||||
{0x67, "FldOutS03"}, // 103
|
||||
{0x68, "FldOutS02"}, // 104
|
||||
{0x69, "FldOutS04"}, // 105
|
||||
{0x6A, "FldOutNEStone00"}, // 106
|
||||
{0x6B, "FldOutNStone03"}, // 107
|
||||
{0x6C, "FldOutNStone02"}, // 108
|
||||
{0x6D, "FldOutNStone01"}, // 109
|
||||
{0x6E, "FldOutNStoneR00"}, // 110
|
||||
{0x6F, "FldOutNStoneL00"}, // 111
|
||||
{0x70, "FldOutNStone00"}, // 112
|
||||
{0x71, "FldOutNStone04"}, // 113
|
||||
{0x73, "FldOutEIslandDown01"}, // 115
|
||||
{0x74, "FldOutEIslandDown00"}, // 116
|
||||
{0x75, "FldOutEIslandUp00"}, // 117
|
||||
{0x76, "FldOutEIslandUp01"}, // 118
|
||||
{0x77, "FldOutWStone01"}, // 119
|
||||
{0x78, "FldOutWStone00"}, // 120
|
||||
{0x79, "FldOutEStone00"}, // 121
|
||||
{0x7A, "FldOutEStone01"}, // 122
|
||||
{0x7B, "FldOutNEStone01"}, // 123
|
||||
{0x7C, "FldOutNWStone01"}, // 124
|
||||
{0x7D, "FldOutNWStone00"}, // 125
|
||||
{0x7E, "FldOutWCliff00"}, // 126
|
||||
{0x7F, "FldOutW04"}, // 127
|
||||
{0x80, "FldOutNShip02"}, // 128
|
||||
{0x81, "FldOutNShip01"}, // 129
|
||||
{0x83, "FldOutWCliff01"}, // 131
|
||||
{0x84, "FldOutSRiver01"}, // 132
|
||||
{0x85, "FldOutWRiver01"}, // 133
|
||||
{0x86, "FldOutERiver01"}, // 134
|
||||
{0x87, "FldOutSWBridge01"}, // 135
|
||||
{0x88, "FldOutSWBridge00"}, // 136
|
||||
{0x89, "FldOutSEBridge01"}, // 137
|
||||
{0x8A, "FldOutSEBridge00"}, // 138
|
||||
{0x8B, "FldOutECliff01"}, // 139
|
||||
{0x8C, "FldOutECliff00"}, // 140
|
||||
{0x8D, "FldOutWIslandDown00"}, // 141
|
||||
{0x8E, "FldOutWIslandDown01"}, // 142
|
||||
{0x8F, "FldOutWIslandUp00"}, // 143
|
||||
{0x90, "FldOutWIslandUp01"}, // 144
|
||||
{0x91, "FldOutEStone02"}, // 145
|
||||
{0x92, "FldOutWStone02"}, // 146
|
||||
{0x93, "FldOutSeaN02"}, // 147
|
||||
{0x94, "FldOutSeaN01"}, // 148
|
||||
{0x97, "FldOutSeaW02"}, // 151
|
||||
{0x98, "FldOutSeaW01"}, // 152
|
||||
{0x9B, "FldOutSeaS02"}, // 155
|
||||
{0x9C, "FldOutSeaS01"}, // 156
|
||||
{0x9D, "FldOutSeaSW02"}, // 157
|
||||
{0x9E, "FldOutSeaSW01"}, // 158
|
||||
{0x9F, "FldOutSeaNW02"}, // 159
|
||||
{0xA0, "FldOutSeaNW01"}, // 160
|
||||
{0xA1, "FldOutSeaN05"}, // 161
|
||||
{0xA2, "FldOutSeaN04"}, // 162
|
||||
{0xA3, "FldOutSeaN03"}, // 163
|
||||
{0xA4, "FldOutSeaN08"}, // 164
|
||||
{0xA5, "FldOutSeaN07"}, // 165
|
||||
{0xA6, "FldOutSeaN06"}, // 166
|
||||
{0xAC, "FldOutSeaNW03"}, // 172
|
||||
{0xAD, "FldOutSeaW08"}, // 173
|
||||
{0xAE, "FldOutSeaW07"}, // 174
|
||||
{0xAF, "FldOutSeaW06"}, // 175
|
||||
{0xB0, "FldOutSeaW04"}, // 176
|
||||
{0xB1, "FldOutSeaW05"}, // 177
|
||||
{0xB2, "FldOutSeaW03"}, // 178
|
||||
{0xB8, "FldOutSeaSW03"}, // 184
|
||||
{0xBF, "FldOutSeaS05"}, // 191
|
||||
{0xC0, "FldOutSeaS04"}, // 192
|
||||
{0xC1, "FldOutSeaS03"}, // 193
|
||||
{0xC2, "FldOutSeaS08"}, // 194
|
||||
{0xC3, "FldOutSeaS07"}, // 195
|
||||
{0xC4, "FldOutSeaS06"}, // 196
|
||||
{0xC5, "FldOutSeaSE02"}, // 197
|
||||
{0xC6, "FldOutSeaSE01"}, // 198
|
||||
{0xC8, "FldOutSeaSE03"}, // 200
|
||||
{0xCD, "FldOutSeaE05"}, // 205
|
||||
{0xCE, "FldOutSeaE04"}, // 206
|
||||
{0xCF, "FldOutSeaE03"}, // 207
|
||||
{0xD0, "FldOutSeaE01"}, // 208
|
||||
{0xD1, "FldOutSeaE02"}, // 209
|
||||
{0xD2, "FldOutSeaE08"}, // 210
|
||||
{0xD3, "FldOutSeaE06"}, // 211
|
||||
{0xD4, "FldOutSeaE07"}, // 212
|
||||
{0xD8, "FldOutSeaNE03"}, // 216
|
||||
{0xDB, "FldOutSeaNE01"}, // 219
|
||||
{0xDC, "FldOutSeaNE02"}, // 220
|
||||
{0xDE, "FldOutSBridge00"}, // 222
|
||||
{0xDF, "FldOutWIslandDown02"}, // 223
|
||||
{0xE0, "FldOutWIslandUp02"}, // 224
|
||||
{0xE1, "FldOutEIslandDown02"}, // 225
|
||||
{0xE2, "FldOutEIslandUp02"}, // 226
|
||||
{0xE3, "FldOutECliff02"}, // 227
|
||||
{0xE4, "FldOutWCliff02"}, // 228
|
||||
{0xE5, "FldOutNEStone02"}, // 229
|
||||
{0xE6, "FldOutNWStone02"}, // 230
|
||||
{0xE7, "FldOutEStone03"}, // 231
|
||||
{0xE8, "FldOutWStone03"}, // 232
|
||||
{0xE9, "FldOutSRiver02"}, // 233
|
||||
{0xF0, "FldOutPhotoSBridge00"}, // 240
|
||||
{0xF1, "FldOutPhotoSE00"}, // 241
|
||||
{0xF2, "FldOutPhotoSW00"}, // 242
|
||||
{0xF3, "FldOutSBridge02"}, // 243
|
||||
{0xF4, "FldOutSBridge01"}, // 244
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using NHSE.Core;
|
||||
|
||||
|
|
@ -44,17 +44,25 @@ public AcreEditor(MainSave sav)
|
|||
|
||||
private void UpdateAcre(ushort val, int x, int y)
|
||||
{
|
||||
var name = OutsideAcreList.GetName(val);
|
||||
var name = (OutsideAcre)val;
|
||||
L_Hovered.Text = $"{x},{y} - 0x{val:X2} = {name}";
|
||||
L_Hovered.Visible = true;
|
||||
}
|
||||
|
||||
private void LoadHintComboBox()
|
||||
{
|
||||
var acres = OutsideAcreList.Names.Select(z => $"{z.Value} - {z.Key:X}").ToList();
|
||||
acres.Sort();
|
||||
foreach (var name in acres)
|
||||
CB_AcreNames.Items.Add(name);
|
||||
var names = Enum.GetNames(typeof(OutsideAcre));
|
||||
var values = (OutsideAcre[])Enum.GetValues(typeof(OutsideAcre));
|
||||
|
||||
var acres = new List<ComboItem>(names.Length);
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
acres.Add(new ComboItem($"{names[i]} - {values[i]:X}", (ushort) values[i]));
|
||||
acres.SortByText();
|
||||
|
||||
CB_AcreNames.DisplayMember = nameof(ComboItem.Text);
|
||||
CB_AcreNames.ValueMember = nameof(ComboItem.Value);
|
||||
CB_AcreNames.DataSource = acres;
|
||||
|
||||
CB_AcreNames.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user