git_brcal/src/BreCalClient/ShipModel.cs

35 lines
766 B
C#

// Copyright (c) 2023 schick Informatik
// Description: Helper class to display/search ships
//
using BreCalClient.misc.Model;
using System;
namespace BreCalClient
{
public class ShipModel
{
public ShipModel(Ship ship) {
this.Ship = ship;
}
public Ship Ship { get; private set; }
public string TugCompany
{
get { if(this.Ship.ParticipantId.HasValue)
{
return BreCalLists.ParticipantLookupDict[this.Ship.ParticipantId.Value].Name;
}
return "";
}
}
public override string ToString()
{
return String.Format("{0} ({1})", this.Ship.Name, this.Ship.Imo);
}
}
}