Beispiel #1
0
        private Adventure(EntityCollection entities, WorldTime time)
        {
            // Assign values
            Entities = entities;
            Time     = time;
            Changed  = false;

            // Bind events
            Time.TimeChanged += Time_TimeChanged;
            Entities.Changed += Entities_Changed;
        }
Beispiel #2
0
        public TimeDisplay(WorldTime worldTime, Settings settings)
        {
            _worldTime = worldTime;
            _settings  = settings;

            this.SuspendLayout();

            // Format this
            this.RowCount    = 2;
            this.ColumnCount = 1;

            // Format DateTime label
            _dateTimeLabel = new Label
            {
                Anchor = AnchorStyles.None,
                Font   = new Font(FontFamily.GenericSansSerif, 20.0f)
            };
            this.Controls.Add(_dateTimeLabel);

            // Format progress bar
            _progressBar = new ProgressBar();
            this.Controls.Add(_progressBar);
            _progressBar.Dock    = DockStyle.Fill;
            _progressBar.Minimum = 0;
            _progressBar.Maximum = 10000;

            // Set time
            UpdateTime();

            // Format table
            this.RowStyles.Clear();
            this.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
            this.RowStyles.Add(new RowStyle(SizeType.Absolute, 30));

            // Add events
            worldTime.TimeChanged       += WorldTime_TimeChanged;
            settings.DateFormat.Changed += DateFormat_Changed;
            settings.Calendar.Changed   += Calendar_Changed;

            this.ResumeLayout();
        }
Beispiel #3
0
 public static bool Equals(WorldTime t1, WorldTime t2)
 {
     return(t1.CompareTo(t2) == 0);
 }
Beispiel #4
0
 public int CompareTo(WorldTime t1)
 {
     return(Time.CompareTo(t1.Time));
 }