Ejemplo n.º 1
0
        /// <summary>
        /// 将蓝图转换成一个要显示的 ListViewItem
        /// </summary>
        /// <returns></returns>
        public ListViewItem ListViewItem()
        {
            ListViewItem lvi = new ListViewItem();

            // 蓝图名称
            if (BluePrints == null)
            {
                lvi.Text = invTypes.GetInvTypes(BluePrintID).Name;
            }
            else
            {
                lvi.Text = BluePrints.invTypes.Name;
            }

            lvi.SubItems.Add(ID.ToString());
            lvi.SubItems.Add(ItemID.ToString());
            lvi.SubItems.Add(BluePrintID.ToString());
            lvi.SubItems.Add(MaterialEfficiency.ToString());
            lvi.SubItems.Add(TimeEfficiency.ToString());
            lvi.SubItems.Add(Quantity.ToString());
            lvi.SubItems.Add(Runs.ToString());

            // 如果是角色拥有则显示角色名称, 否则直接显示"军团"
            if (CharacterOwned)
            {
                if (Characters == null)
                {
                    lvi.SubItems.Add(Characters.GetCharacters(Owner).CharacterName);
                }
                else
                {
                    lvi.SubItems.Add(Characters.CharacterName);
                }
            }
            else
            {
                lvi.SubItems.Add("军团");
            }

            lvi.SubItems.Add(LocationID.ToString());
            lvi.SubItems.Add(LocationFlag.ToString());
            lvi.SubItems.Add(UpdateTime.ToString());
            lvi.SubItems.Add(Cost.ToString());

            return(lvi);
        }
Ejemplo n.º 2
0
        public string ToFormat()
        {
            string str = UpdateTime.ToString("yyyyMMddHHmmssfff");

            str += "," + (MMSI == 0 ? ID : MMSI.ToString());
            str += "," + Name;
            str += "," + ShipCargoType;
            str += "," + CallSign;
            str += "," + IMO_Number;
            str += "," + Length;
            str += "," + Width;
            str += "," + Math.Round(Longitude, 7);
            str += "," + Math.Round(Latitude, 7);
            str += "," + Math.Round(SOG, 1);
            str += "," + Math.Round(COG, 1);
            str += "," + TrueHeading;
            try
            {
                str += "," + NationMgr.GetNationFromMMSI(MMSI);
            }
            catch { }
            return(str);
        }