-
Notifications
You must be signed in to change notification settings - Fork 6
/
LoggedInNonCoreComponent.swift
50 lines (41 loc) · 1.24 KB
/
LoggedInNonCoreComponent.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// LoggedInNonCoreComponent.swift
// LoggedInPluginPoint
//
// Created by Angel Cortez on 4/22/20.
//
import Models
import NeedleFoundation
import ScoreSheet
public protocol LoggedInNonCoreDependency: Dependency {
var playersStream: PlayersStream { get }
var configuration: [String:Any] { get }
var scoreStream: ScoreStream { get }
var player1Name: String { get }
var player2Name: String { get }
}
/// Component for the LoggedIn non core scope.
public class LoggedInNonCoreComponent: NonCoreComponent<LoggedInNonCoreDependency>, ScoreSheetDependency {
var scoreSheetComponent: ScoreSheetComponent {
return ScoreSheetComponent(dependency: self)
}
fileprivate var scoreSheetBuilder: ScoreSheetBuilder {
return ScoreSheetBuilder { [weak self] in
self!.scoreSheetComponent
}
}
public var scoreStream: ScoreStream {
return dependency.scoreStream
}
public var player1Name: String {
dependency.player1Name
}
public var player2Name: String {
dependency.player2Name
}
public var loggedInPluginFactory: ILoggedInPluginFactory {
return LoggedInPluginFactory(plugins: [
scoreSheetBuilder
])
}
}