using System;

namespace Counters
{
    // Listing 3-3
    public class Counter
    {
        private int _count;
        private static int _totalCount;

        public int GetNextValue()
        {
            _count += 1;
            // Listing 3-5 oto rozwiązanie alternatywne:
            //this._count += 1;
            _totalCount += 1;
            return _count;
        }

        public static int TotalCount
        {
            get
            {
                return _totalCount;
            }
        }
    }
}
