OSDN Git Service

DPIスケーリング時に連合艦隊表示がずれるのを直す
[kancollesniffer/KancolleSniffer.git] / KancolleSniffer / ShipMaster.cs
index 0962641..8debfab 100644 (file)
@@ -1,19 +1,16 @@
 // Copyright (C) 2014, 2015 Kazuhiro Fujieda <fujieda@users.osdn.me>\r
 // \r
-// This program is part of KancolleSniffer.\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
 //\r
-// KancolleSniffer is free software: you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation, either version 3 of the License, or\r
-// (at your option) any later version.\r
+//    http://www.apache.org/licenses/LICENSE-2.0\r
 //\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, see <http://www.gnu.org/licenses/>.\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
 \r
 using System.Collections.Generic;\r
 \r
@@ -29,12 +26,13 @@ namespace KancolleSniffer
             var dict = new Dictionary<double, string>();\r
             foreach (var entry in json.api_mst_stype)\r
                 dict[entry.api_id] = entry.api_name;\r
-            dict[8] = "高速戦艦" ;\r
+            dict[8] = "高速戦艦";\r
             foreach (var entry in json.api_mst_ship)\r
             {\r
                 var shipSpec = _shipSpecs[(int)entry.api_id] = new ShipSpec\r
                 {\r
                     Id = (int)entry.api_id,\r
+                    SortNo = entry.api_sortno() ? (int)entry.api_sortno : 0,\r
                     Name = ShipName(entry),\r
                     FuelMax = entry.api_fuel_max() ? (int)entry.api_fuel_max : 0,\r
                     BullMax = entry.api_bull_max() ? (int)entry.api_bull_max : 0,\r
@@ -59,16 +57,13 @@ namespace KancolleSniffer
             return name + "(" + flagship + ")";\r
         }\r
 \r
-        public void InspectStype(dynamic json)\r
-        {\r
-        }\r
-\r
         public ShipSpec this[int id] => _shipSpecs[id];\r
     }\r
 \r
     public class ShipSpec\r
     {\r
         public int Id { get; set; }\r
+        public int SortNo { get; set; }\r
         public string Name { get; set; }\r
         public int FuelMax { get; set; }\r
         public int BullMax { get; set; }\r
@@ -116,6 +111,36 @@ namespace KancolleSniffer
             }\r
         }\r
 \r
+        public double TransportPoint\r
+        {\r
+            get\r
+            {\r
+                switch (ShipType)\r
+                {\r
+                    case 2:\r
+                        return 5.0;\r
+                    case 3:\r
+                        return 2.0;\r
+                    case 6:\r
+                        return 4.0;\r
+                    case 10:\r
+                        return 7.0;\r
+                    case 15:\r
+                        return 15.0;\r
+                    case 16:\r
+                        return 9.0;\r
+                    case 17:\r
+                        return 12.0;\r
+                    case 20:\r
+                        return 7.0;\r
+                    case 21:\r
+                        return 6.0;\r
+                    default:\r
+                        return 0;\r
+                }\r
+            }\r
+        }\r
+\r
         public bool IsSubmarine => ShipType == 13 || ShipType == 14;\r
 \r
         public bool IsAircraftCarrier => ShipType == 7 || ShipType == 11 || ShipType == 18;\r
@@ -135,10 +160,13 @@ namespace KancolleSniffer
                     case 16: // 水母\r
                     case 17: // 揚陸艦\r
                     case 21: // 練巡\r
+                    case 22: // 補給艦\r
                         return true;\r
                 }\r
                 return false;\r
             }\r
         }\r
+\r
+        public bool IsRepairShip => ShipType == 19;\r
     }\r
 }
\ No newline at end of file