Update Osztály diagram: dispatcher rendszerek authored by Sárközi Gergely János's avatar Sárközi Gergely János
...@@ -79,3 +79,42 @@ enum Phase{ ...@@ -79,3 +79,42 @@ enum Phase{
```plantuml ```plantuml
``` ```
# Dispatcher rendszerek
```plantuml
package Logic.Event {
class EventDispatcher {
{field} + <<delegate>> Listener<T : BaseEvent>(T) : void
- _listeners : IDictionary<Type, IList<Delegate>>
+ AddListener<T : BaseEvent>(Listener<T>) : void
+ RemoveListener<T : BaseEvent>(Listener<T>) : void
+ Raise(BaseEvent) : void
}
abstract BaseEvent
EventDispatcher --> BaseEvent
}
package Logic.Command {
class CommandDispatcher {
{field} + <<delegate>> Consumer<TC : BaseCommand<TR>, TR : ICommandResult>(T) : TR
- _consumers : IDictionary<Type, Delegate>
+ RegisterConsumer<TC, TR>(BaseCommand<TC, TR>) : void
+ RemoveConsumer<TC, TR>(BaseCommand<TC, TR>) : void
+ Issue<T : ICommandResult>(BaseCommand<T>) : T
}
abstract BaseCommand<T : ICommandResult>
CommandDispatcher --> BaseCommand
interface ICommandResult {
+ IsSuccess() : bool
}
BaseCommand --> ICommandResult
}
```