--- /dev/null
+75,ドラム缶(輸送用),5.0\r
+68,大発動艇,8.0\r
+193,特大発動艇,8.0\r
+166,大発動艇(八九式中戦車&陸戦隊),8.0\r
+230,特大発動艇+戦車第11連隊,8.0\r
+167,特二式内火艇,2.0\r
+145,戦闘糧食,1.0\r
+150,秋刀魚の缶詰,1.0\r
+241,戦闘糧食(特別なおにぎり),1.0\r
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<PropertyGroup>\r
- <PostBuildEvent>COPY $(SolutionDir)\Data\EnemySlot.csv $(TargetDir)</PostBuildEvent>\r
+ <PostBuildEvent>COPY $(SolutionDir)\Data\*.* $(TargetDir)</PostBuildEvent>\r
</PropertyGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
[TestMethod]\r
public void TransportPoint()\r
{\r
+ ItemSpec.LoadTpSpec();\r
+\r
var sniffer1 = new Sniffer();\r
SniffLogFile(sniffer1, "transportpoint_001");\r
- ItemSpec.IncreaceLandPowerTp = false;\r
PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 27);\r
- ItemSpec.IncreaceLandPowerTp = true;\r
- PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 37, "陸上戦力揚陸時");\r
\r
var sniffer2 = new Sniffer();\r
SniffLogFile(sniffer2, "transportpoint_002");\r
// See the License for the specific language governing permissions and\r
// limitations under the License.\r
\r
+using System;\r
using System.Collections.Generic;\r
using System.Drawing;\r
+using System.IO;\r
using System.Linq;\r
using static System.Math;\r
\r
}\r
}\r
\r
+ private static Dictionary<int, double> _tpSpec;\r
+\r
+ public static void LoadTpSpec()\r
+ {\r
+ try\r
+ {\r
+ _tpSpec = File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TP.csv"))\r
+ .Select(line => line.Split(','))\r
+ .ToDictionary(f => int.Parse(f[0]), f => double.Parse(f[2]));\r
+ }\r
+ catch (IOException)\r
+ {\r
+ }\r
+ }\r
+\r
public double TransportPoint\r
{\r
get\r
{\r
+ if (_tpSpec != null && _tpSpec.TryGetValue(Id, out var tp))\r
+ return tp;\r
switch (Id)\r
{\r
case 75: // ドラム缶(輸送用)\r
case 193: // 特大発動艇\r
return 8.0;\r
case 166: // 大発動艇(八九式中戦車&陸戦隊)\r
- return IncreaceLandPowerTp ? 13.0 : 8.0;\r
+ return 8.0;\r
case 167: // 特二式内火艇\r
- return IncreaceLandPowerTp ? 7.0 : 2.0;\r
+ return 2.0;\r
case 230: // 特大発動艇+戦車第11連隊\r
return 8.0;\r
case 145: // 戦闘糧食\r
return 1.0;\r
case 150: // 秋刀魚の缶詰\r
return 1.0;\r
+ case 241: // 戦闘糧食(特別なおにぎり)\r
+ return 1.0;\r
default:\r
return 0;\r
}\r
return LoS <= 7 ? 1.2 : 1.3;\r
case 10:\r
case 41:\r
- return LoS <= 7 ? 1.1 : LoS <= 8 ? 1.13 : 1.16;\r
+ return LoS <= 7 ? 1.1 :\r
+ LoS <= 8 ? 1.13 : 1.16;\r
}\r
return 1;\r
}\r
</ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<PropertyGroup>\r
- <PostBuildEvent>COPY $(SolutionDir)\Data\EnemySlot.csv $(TargetDir)</PostBuildEvent>\r
+ <PostBuildEvent>COPY $(SolutionDir)\Data\*.* $(TargetDir)</PostBuildEvent>\r
</PropertyGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
_proxyManager.UpdatePacFile();\r
PerformZoom();\r
_shipLabels.AdjustAkashiTimers();\r
- LoadState();\r
+ LoadData();\r
_sniffer.RepeatingTimerController = new RepeatingTimerController(_notificationManager, _config);\r
}\r
\r
private readonly FileSystemWatcher _watcher = new FileSystemWatcher\r
{\r
Path = AppDomain.CurrentDomain.BaseDirectory,\r
- Filter = "status.xml",\r
NotifyFilter = NotifyFilters.LastWrite\r
};\r
\r
private readonly Timer _watcherTimer = new Timer {Interval = 1000};\r
\r
- private void LoadState()\r
+ private void LoadData()\r
{\r
+ var target = "";\r
_sniffer.LoadState();\r
+ ItemSpec.LoadTpSpec();\r
_watcher.SynchronizingObject = this;\r
_watcherTimer.Tick += (sender, ev) =>\r
{\r
_watcherTimer.Stop();\r
- _sniffer.LoadState();\r
+ switch (target)\r
+ {\r
+ case "status.xml":\r
+ _sniffer.LoadState();\r
+ break;\r
+ case "TP.csv":\r
+ ItemSpec.LoadTpSpec();\r
+ break;\r
+ }\r
};\r
_watcher.Changed += (sender, ev) =>\r
{\r
+ target = ev.Name;\r
_watcherTimer.Stop();\r
_watcherTimer.Start();\r
};\r