All pastes #256651 Raw Edit

Zuu

public text v1 · immutable
#256651 ·published 2006-11-24 14:04 UTC
rendered paste body
class Seat
{
	private int table = 0;
	private int seat = 0;
	private string username = "";

	public Seat(int table, int seat, string username)
	{
		this.table = table;
		this.seat = seat;
		this.username = username;
	}

	public Seat(int table, int seat)
		: this(table, seat, "")
	{
	}

	/// <summary>
	/// Optager denne plads med en bruger der tilhører et givent brugernavn
	/// </summary>
	/// <param name="username"></param>
	/// <returns></returns>
	public void reserveSeat(string username)
	{
		this.username = username;
	}

	public bool Reserved()
	{
		return this.username.Length > 0;
	}

	public int SeatNbr
	{
		get { return this.seat; }
	}

	public int TableNbr
	{
		get { return this.table; }
	}

	public override string ToString()
	{
        return "Bord: " + this.TableNbr + " plads: " + this.SeatNbr;
	}

}