Created
January 10, 2018 21:59
-
-
Save pawndev/65336179ab90b777cfe02347c4410cc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace PawnLib.Utils | |
{ | |
public interface IStore | |
{ | |
} | |
public class Store // implement Store with the Command Pattern | |
{ | |
} | |
public sealed class StoreContainer | |
{ | |
private static readonly Lazy<StoreContainer> lazy = new Lazy<StoreContainer>(() => new StoreContainer()); | |
public static StoreContainer Instance { get { return lazy.Value; } } | |
private Dictionary<string, Store> Collections { get; set; } | |
public StoreContainer() | |
{ | |
this.Collections.Add("Default", new Store()); | |
} | |
public StoreContainer Add(string name, Store newStore) | |
{ | |
this.Collections.Add(name, newStore); | |
return this; | |
} | |
public Store Get(string name) | |
{ | |
return this.Collections[name]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment