Exemple #1
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="wareID">ウェアID</param>
 /// <param name="name">ウェア名</param>
 /// <param name="wareGroup">ウェア種別</param>
 /// <param name="transportType">カーゴ種別</param>
 /// <param name="volume">大きさ</param>
 /// <param name="minPrice">最低価格</param>
 /// <param name="maxPrice">最高価格</param>
 private Ware(string wareID, string name, WareGroup wareGroup, TransportType transportType, long volume, long minPrice, long maxPrice)
 {
     WareID        = wareID;
     Name          = name;
     WareGroup     = wareGroup;
     TransportType = transportType;
     Volume        = volume;
     MinPrice      = minPrice;
     MaxPrice      = maxPrice;
 }
Exemple #2
0
        /// <summary>
        /// 初期化
        /// </summary>
        public static void Init()
        {
            _Wares.Clear();
            X4Database.Instance.ExecQuery($"SELECT * FROM Ware", (dr, args) =>
            {
                var id            = (string)dr["WareID"];
                var name          = (string)dr["Name"];
                var volume        = (long)dr["Volume"];
                var minPrice      = (long)dr["MinPrice"];
                var maxPrice      = (long)dr["MaxPrice"];
                var wareGroup     = WareGroup.Get((string)dr["WareGroupID"]);
                var transportType = TransportType.Get((string)dr["TransportTypeID"]);

                _Wares.Add(id, new Ware(id, name, wareGroup, transportType, volume, minPrice, maxPrice));
            });
        }