Beispiel #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);
 }
Beispiel #3
0
 public void AddStory(StoryId id, string name)
 {
     Stories.Add(new StoryItem()
     {
         Name  = name,
         Story = id
     });
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #10
0
 public void FocusStory(StoryId id, string name)
 {
     _action(id, name);
     _viewport.SelectStory(id, name);
 }
Beispiel #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;
 }
Beispiel #13
0
 public ArchiveItem(Identity id, StoryId storyId)
 {
     Id = id;
     StoryId = storyId;
 }
Beispiel #14
0
 public AddTaskToStory(TaskId taskId, StoryId storyId)
 {
     TaskId = taskId;
     StoryId = storyId;
 }
Beispiel #15
0
 public CreateStoryFromBlog(StoryId id, BlogId blogId, string author, string title, string body)
 {
     Id = id;
     BlogId = blogId;
     Author = author;
     Title = title;
     Body = body;
 }
Beispiel #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;
 }
Beispiel #17
0
 public AddTask(string text, StoryId storyId)
 {
     Text = text;
     StoryId = storyId;
 }
Beispiel #18
0
 public NoteAdded(NoteId noteId, string title, string text, StoryId storyId)
 {
     NoteId = noteId;
     Title = title;
     Text = text;
     StoryId = storyId;
 }
Beispiel #19
0
 public StoryRating ToEntity() => new(new StoryRatingId(StoryId, UserId), Rate);
Beispiel #20
0
 public NoteArchived(NoteId noteId, StoryId storyId)
 {
     NoteId = noteId;
     StoryId = storyId;
 }
Beispiel #21
0
 public TagAddedToStory(StoryId storyId, TagId tagId, string tag, string storyName)
 {
     StoryId = storyId;
     TagId = tagId;
     Tag = tag;
     StoryName = storyName;
 }
Beispiel #22
0
 public SimpleStoryStarted(StoryId storyId, string name)
 {
     StoryId = storyId;
     Name = name;
 }
Beispiel #23
0
 public SimpleStoryRenamed(StoryId storyId, string oldName, string newName)
 {
     StoryId = storyId;
     OldName = oldName;
     NewName = newName;
 }
Beispiel #24
0
 public NoteRenamed(NoteId noteId, string oldName, string newName, StoryId storyId)
 {
     NoteId = noteId;
     OldName = oldName;
     NewName = newName;
     StoryId = storyId;
 }
Beispiel #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;
 }
Beispiel #28
0
 public TaskAdded(TaskId taskId, string text, StoryId storyId)
 {
     TaskId = taskId;
     Text = text;
     StoryId = storyId;
 }
Beispiel #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);
 }
Beispiel #31
0
 public TaskArchived(TaskId taskId, StoryId storyId)
 {
     TaskId = taskId;
     StoryId = storyId;
 }
 protected AbstractItem(StoryId story)
 {
     Story = story;
 }
Beispiel #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;

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