public InteractionProcessor(IMessageSender sender, LifelineViewport viewport, NuclearStorage storage) { _sender = sender; _viewport = viewport; _storage = storage; CurrentStoryId = new StoryId(Guid.Empty); }
public void AddStory(StoryId id, string name) { Stories.Add(new StoryItem() { Name = name, Story = id }); }
public InteractionRequest(string data, StoryId currentStoryId, string raw, IDictionary <string, Identity> lookup, string currentStoryName) { Data = data; CurrentStoryId = currentStoryId; Raw = raw; _lookup = lookup; CurrentStoryName = currentStoryName; }
public void Json_should_work_with_identities() { var id = new StoryId(Guid.NewGuid()); var s = JsonSerializer.SerializeToString(id); Console.WriteLine(s); var deserialized = JsonSerializer.DeserializeFromString<StoryId>(s); Assert.AreEqual(id, deserialized); }
public void ProtoBuf_should_work_with_identities() { var id = new StoryId(Guid.Empty); var metaType = RuntimeTypeModel.Default[typeof(StoryId)]; RuntimeTypeModel.Default.Add(typeof (Identity), true); metaType.UseConstructor = false; metaType.Add("Tag", "Id"); var deserialized = Serializer.DeepClone(id); Assert.AreEqual(id, deserialized); }
public override int GetHashCode() { unchecked { var hash = 17; hash = hash * 29 + DistributorCode.GetHashCode(); hash = hash * 29 + StoryId.GetHashCode(); hash = hash * 29 + Timestamp.GetHashCode(); return(hash); } }
public bool TryGetStory<TStory>(StoryId storyId, out TStory story) where TStory : AbstractStory { AbstractStory value; if (_stories.TryGetValue(storyId, out value)) { story = value as TStory; if (story != null) { return true; } } story = null; return false; }
public void FocusStory(StoryId id, string name) { _action(id, name); _viewport.SelectStory(id, name); }
public async Task <int> GetTotalRatingAsync(StoryId storyId) => await _database.GetCollection <StoryRatingDocument>("ratings") .AsQueryable() .Where(x => x.StoryId == storyId) .SumAsync(x => x.Rate);
public StoryRatingId(StoryId storyId, UserId userId) { StoryId = storyId; UserId = userId; }
public ArchiveItem(Identity id, StoryId storyId) { Id = id; StoryId = storyId; }
public AddTaskToStory(TaskId taskId, StoryId storyId) { TaskId = taskId; StoryId = storyId; }
public CreateStoryFromBlog(StoryId id, BlogId blogId, string author, string title, string body) { Id = id; BlogId = blogId; Author = author; Title = title; Body = body; }
public StoryCreatedFromBlog(StoryId id, BlogId blogId, string author, DateTime timeUtc, string title, string body) { Id = id; BlogId = blogId; Author = author; TimeUtc = timeUtc; Title = title; Body = body; }
public AddTask(string text, StoryId storyId) { Text = text; StoryId = storyId; }
public NoteAdded(NoteId noteId, string title, string text, StoryId storyId) { NoteId = noteId; Title = title; Text = text; StoryId = storyId; }
public StoryRating ToEntity() => new(new StoryRatingId(StoryId, UserId), Rate);
public NoteArchived(NoteId noteId, StoryId storyId) { NoteId = noteId; StoryId = storyId; }
public TagAddedToStory(StoryId storyId, TagId tagId, string tag, string storyName) { StoryId = storyId; TagId = tagId; Tag = tag; StoryName = storyName; }
public SimpleStoryStarted(StoryId storyId, string name) { StoryId = storyId; Name = name; }
public SimpleStoryRenamed(StoryId storyId, string oldName, string newName) { StoryId = storyId; OldName = oldName; NewName = newName; }
public NoteRenamed(NoteId noteId, string oldName, string newName, StoryId storyId) { NoteId = noteId; OldName = oldName; NewName = newName; StoryId = storyId; }
public NoteEdited(NoteId noteId, string newText, string oldText, StoryId storyId) { NoteId = noteId; NewText = newText; OldText = oldText; StoryId = storyId; }
public NoteItem(string title, string text, NoteId id, StoryId story) : base(story) { Title = title; Text = text; Id = id; }
public SimpleStory(string name, StoryId id) { Name = name; Id = id; }
public TaskAdded(TaskId taskId, string text, StoryId storyId) { TaskId = taskId; Text = text; StoryId = storyId; }
public AddNote(string title, string text, StoryId storyId) { Title = title; Text = text; StoryId = storyId; }
public bool StoryExists(StoryId storyId) { return _stories.ContainsKey(storyId); }
public TaskArchived(TaskId taskId, StoryId storyId) { TaskId = taskId; StoryId = storyId; }
protected AbstractItem(StoryId story) { Story = story; }
public TaskCompleted(TaskId taskId, StoryId storyId) { TaskId = taskId; StoryId = storyId; }
public TaskItem(string name, TaskId id, StoryId storyId) : base (storyId) { Name = name; Id = id; }
public TaskRenamed(TaskId taskId, string oldText, string newText, StoryId storyId) { TaskId = taskId; OldText = oldText; NewText = newText; StoryId = storyId; }