﻿namespace RogueEngine.Core.Contracts
{
    public abstract class Singleton<TSingletonType> where TSingletonType: class, new()
    {
        private static TSingletonType instance;

        public static TSingletonType Instance
        {
            get
            {
                if (instance == default(TSingletonType))
                {
                    instance = new TSingletonType();
                }

                return instance;
            }
        }
    }
}
