using System;

namespace SportModel
{
    public class Marathon
    {
        // instance property
        public string Naam { get; set; }

        private TimeSpan _record;

        // instance property
        public TimeSpan Record
        {
            get
            {
                return _record;
            }
            set
            {
                _record = value;
                if (value < WereldRecord)
                {
                    WereldRecord = value;
                }
            }
        }

        // static property
        public static TimeSpan WereldRecord { get; set; }

        public Marathon(string naam, TimeSpan record)
        {
            Naam = naam;
            Record = record;
        }

        // static method
        public static bool IsWereldRecord(TimeSpan tijd)
        {
            if (tijd < WereldRecord)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
