1
- using System . Text ;
1
+ using System . Text ;
2
2
using AdventureGrainInterfaces ;
3
3
4
4
namespace AdventureGrains ;
@@ -8,14 +8,11 @@ namespace AdventureGrains;
8
8
/// </summary>
9
9
public class RoomGrain : Grain , IRoomGrain
10
10
{
11
- // TODO: replace placeholder grain interface with actual grain
12
- // communication interface(s).
13
-
11
+ private readonly List < PlayerInfo > _players = [ ] ;
12
+ private readonly List < MonsterInfo > _monsters = [ ] ;
13
+ private readonly List < Thing > _things = [ ] ;
14
+ private readonly Dictionary < string , IRoomGrain > _exits = [ ] ;
14
15
private string ? _description ;
15
- private readonly List < PlayerInfo > _players = new ( ) ;
16
- private readonly List < MonsterInfo > _monsters = new ( ) ;
17
- private readonly List < Thing > _things = new ( ) ;
18
- private readonly Dictionary < string , IRoomGrain > _exits = new ( ) ;
19
16
20
17
Task IRoomGrain . Enter ( PlayerInfo player )
21
18
{
@@ -106,15 +103,19 @@ Task<string> IRoomGrain.Description(PlayerInfo whoisAsking)
106
103
{
107
104
builder . AppendLine ( "Beware! These guys are in the room with you:" ) ;
108
105
if ( others . Length > 0 )
106
+ {
109
107
foreach ( var player in others )
110
108
{
111
109
builder . Append ( " " ) . AppendLine ( player . Name ) ;
112
110
}
111
+ }
113
112
if ( _monsters . Count > 0 )
113
+ {
114
114
foreach ( var monster in _monsters )
115
115
{
116
116
builder . Append ( " " ) . AppendLine ( monster . Name ) ;
117
117
}
118
+ }
118
119
}
119
120
120
121
return Task . FromResult ( builder . ToString ( ) ) ;
0 commit comments