Exemplo n.º 1
0
 public static Actor Create(
     long id,
     ActorTypes actorType,
     string name,
     HitPoints hitPoints)
 {
     return
         (new Actor(
              id,
              actorType,
              name,
              ImmutableDictionary <StatisticTypes, int> .Empty,
              hitPoints,
              ImmutableDictionary <long, Thing> .Empty));
 }
Exemplo n.º 2
0
 public static Actor Create(
     long id,
     ActorTypes actorType,
     string name,
     IStatisticsStore statistics,
     HitPoints hitPoints,
     IThingStore things)
 {
     return
         (new Actor(
              id,
              actorType,
              name,
              statistics,
              hitPoints,
              things));
 }
Exemplo n.º 3
0
        private Actor(
            long id,
            ActorTypes actorType,
            string name,
            IStatisticsStore statistics,
            HitPoints hitPoints,
            IThingStore things)
        {
            Debug.Assert(name != null);
            Debug.Assert(statistics != null);
            Debug.Assert(hitPoints != null);
            Debug.Assert(things != null);

            _id         = id;
            _actorType  = actorType;
            _name       = name;
            _statistics = statistics;
            _hitPoints  = hitPoints;
            _things     = things;
        }
Exemplo n.º 4
0
 public Actor With(
     long?id = null,
     ActorTypes?actorType        = null,
     string name                 = null,
     IStatisticsStore statistics = null,
     HitPoints hitPoints         = null,
     IThingStore things          = null)
 {
     return
         (id.HasValue ||
          actorType.HasValue ||
          name != null ||
          statistics != null ||
          hitPoints != null ||
          things != null
             ? new Actor(
              id ?? _id,
              actorType ?? _actorType,
              name ?? _name,
              statistics ?? _statistics,
              hitPoints ?? _hitPoints,
              things ?? _things)
             : this);
 }