Example #1
0
 public InteractionProcessor(IMessageSender sender, LifelineViewport viewport, NuclearStorage storage)
 {
     _sender        = sender;
     _viewport      = viewport;
     _storage       = storage;
     CurrentStoryId = new StoryId(Guid.Empty);
 }
 public InteractionProcessor(IMessageSender sender, LifelineViewport viewport, NuclearStorage storage)
 {
     _sender = sender;
     _viewport = viewport;
     _storage = storage;
     CurrentStoryId = new StoryId(Guid.Empty);
 }
Example #3
0
 public void AddStory(StoryId id, string name)
 {
     Stories.Add(new StoryItem()
     {
         Name  = name,
         Story = id
     });
 }
Example #4
0
 public InteractionRequest(string data, StoryId currentStoryId, string raw, IDictionary <string, Identity> lookup, string currentStoryName)
 {
     Data             = data;
     CurrentStoryId   = currentStoryId;
     Raw              = raw;
     _lookup          = lookup;
     CurrentStoryName = currentStoryName;
 }
Example #5
0
 public void AddStory(StoryId id, string name)
 {
     Stories.Add(new StoryItem()
         {
             Name = name,
             Story = id
         });
 }
 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;
 }
Example #10
0
 public void FocusStory(StoryId id, string name)
 {
     _action(id, name);
     _viewport.SelectStory(id, name);
 }
Example #11
0
 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;
 }
Example #13
0
 public ArchiveItem(Identity id, StoryId storyId)
 {
     Id = id;
     StoryId = storyId;
 }
Example #14
0
 public AddTaskToStory(TaskId taskId, StoryId storyId)
 {
     TaskId = taskId;
     StoryId = storyId;
 }
Example #15
0
 public CreateStoryFromBlog(StoryId id, BlogId blogId, string author, string title, string body)
 {
     Id = id;
     BlogId = blogId;
     Author = author;
     Title = title;
     Body = body;
 }
Example #16
0
 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;
 }
Example #17
0
 public AddTask(string text, StoryId storyId)
 {
     Text = text;
     StoryId = storyId;
 }
Example #18
0
 public NoteAdded(NoteId noteId, string title, string text, StoryId storyId)
 {
     NoteId = noteId;
     Title = title;
     Text = text;
     StoryId = storyId;
 }
Example #19
0
 public StoryRating ToEntity() => new(new StoryRatingId(StoryId, UserId), Rate);
Example #20
0
 public NoteArchived(NoteId noteId, StoryId storyId)
 {
     NoteId = noteId;
     StoryId = storyId;
 }
Example #21
0
 public TagAddedToStory(StoryId storyId, TagId tagId, string tag, string storyName)
 {
     StoryId = storyId;
     TagId = tagId;
     Tag = tag;
     StoryName = storyName;
 }
Example #22
0
 public SimpleStoryStarted(StoryId storyId, string name)
 {
     StoryId = storyId;
     Name = name;
 }
Example #23
0
 public SimpleStoryRenamed(StoryId storyId, string oldName, string newName)
 {
     StoryId = storyId;
     OldName = oldName;
     NewName = newName;
 }
Example #24
0
 public NoteRenamed(NoteId noteId, string oldName, string newName, StoryId storyId)
 {
     NoteId = noteId;
     OldName = oldName;
     NewName = newName;
     StoryId = storyId;
 }
Example #25
0
 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;
 }
Example #28
0
 public TaskAdded(TaskId taskId, string text, StoryId storyId)
 {
     TaskId = taskId;
     Text = text;
     StoryId = storyId;
 }
Example #29
0
 public AddNote(string title, string text, StoryId storyId)
 {
     Title = title;
     Text = text;
     StoryId = storyId;
 }
 public bool StoryExists(StoryId storyId)
 {
     return _stories.ContainsKey(storyId);
 }
Example #31
0
 public TaskArchived(TaskId taskId, StoryId storyId)
 {
     TaskId = taskId;
     StoryId = storyId;
 }
 protected AbstractItem(StoryId story)
 {
     Story = story;
 }
Example #33
0
 public TaskCompleted(TaskId taskId, StoryId storyId)
 {
     TaskId = taskId;
     StoryId = storyId;
 }
        public TaskItem(string name, TaskId id, StoryId storyId) : base (storyId)
        {
            Name = name;
            Id = id;

        }
Example #35
0
 public TaskRenamed(TaskId taskId, string oldText, string newText, StoryId storyId)
 {
     TaskId = taskId;
     OldText = oldText;
     NewText = newText;
     StoryId = storyId;
 }