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
| // | |
| // LBTagSync.m | |
| // Life Blog | |
| // | |
| // Created by Sully on 3/1/14. | |
| // Copyright (c) 2014 AllocateThis! Studios. All rights reserved. | |
| // | |
| #import "LBTagSync.h" | |
| #import "LBTagRepository.h" |
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
| public async Task<OperationResult> CreateUser(string username, string email, string password) | |
| { | |
| // We have to convert the keys to camelcase for Parse. | |
| // Regular expressions weren't working. Need to revist them as this is | |
| // creating a large of garbage. | |
| //var userData = new | |
| //{ | |
| // username = username.Substring(0, 1).ToLower() + username.Substring(1), | |
| // email = email.Substring(0, 1).ToLower() + email.Substring(1), | |
| // password = password, |
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
| //----------------------------------------------------------------------- | |
| // <copyright file="EngineTimer.cs" company="Sully"> | |
| // Copyright (c) Johnathon Sullinger. All rights reserved. | |
| // </copyright> | |
| //----------------------------------------------------------------------- | |
| namespace Mud.Engine.Runtime.Core | |
| { | |
| using System; | |
| using System.Diagnostics; | |
| using System.Threading; |
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
| System.InvalidOperationException was unhandled | |
| Message: An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.CodeAnalysis.Workspaces.dll | |
| Additional information: Unexpected value 'IdentifierName' of type 'Microsoft.CodeAnalysis.CSharp.SyntaxKind' |
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
| [TestClass] | |
| public class AccountServiceTests | |
| { | |
| private IAccountService accountService; | |
| [TestInitialize] | |
| public void Setup() | |
| { | |
| // Build our User Repository mock for the account service to use. | |
| var userRepositoryMock = new Mock<IUserRepository>(); |
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
| private static Dictionary<string, Type> cachedStateNames = new Dictionary<string, Type>(); | |
| public static TimeOfDayState CreateStateByName(string name, TimeOfDay stateTime) | |
| { | |
| IEnumerable<Type> timeOfDayStateTypes = typeof(TimeOfDayState).GetTypeInfo().Assembly.ExportedTypes | |
| .Where(type => type.GetTypeInfo().BaseType == typeof(TimeOfDayState)); | |
| if (cachedStateNames.Count == 0) | |
| { | |
| foreach(Type type in timeOfDayStateTypes) |
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
| private List<Func<Task>> ShutdownCallbacks = new List<Func<Task>>(); | |
| public void RegisterShutdownCallback(Func<Task> callback) | |
| { | |
| this.ShutdownCallbacks.Add(callback); | |
| } | |
| public async Task Shutdown() | |
| { | |
| var callbackTasks = new List<Task>(); |
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
| private static void RegisterContainerTypes() | |
| { | |
| var builder = new ContainerBuilder(); | |
| builder.RegisterType<LoggingService>().As<ILoggingService>(); | |
| builder.RegisterType<FileStorageService>().As<IFileStorageService>(); | |
| // Engine runtime types | |
| builder.RegisterType<DefaultGame>().As<DefaultGame>(); | |
| builder.RegisterType<WorldService>().As<IWorldService>(); |
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
| public class World | |
| { | |
| public World(IGame game, IWorldService service) | |
| { | |
| game.RegisterShutdown(async () => service.SaveWorld(this)); | |
| } | |
| } | |
| public static class Program | |
| { |
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
| public interface IMessage | |
| { | |
| T GetContent<T>() where T : class; | |
| } | |
| public abstract class MessageBase<TContentType> : IMessage where TContentType : class | |
| { | |
| TContentType Content { get; } | |
| public abstract TContentType GetContent<ContentType>(); |