Ejemplo n.º 1
0
        public void SpawnBody(Body body, string sceneId)
        {
            if (String.IsNullOrWhiteSpace(body.Name))
            {
                if (_db.HasRole(body.Id, "infected"))
                    body.Name = Names.RandomZombieName();
                else if (body.Cardinality == 0)
                    body.Name = Names.RandomHumanName();

                _db.SetName(body.Id, body.Name);
            }

            _db.PutBodyInScene(body.Id, sceneId);

            // Describe scene to actor.
            Do.DescribeScene(sceneId, body.Id);

            // Notify scene of the arrival.
            var arrival = new CmdToClient("Arrive", JsonConvert.SerializeObject(body));
            _clients.TellScene(sceneId, arrival.ToString());
        }
Ejemplo n.º 2
0
 public static string A(Body gameObject, string name)
 {
     if (gameObject.Cardinality == 0 || String.IsNullOrWhiteSpace(name))
         return name;
     else if (gameObject.Cardinality == 1)
         return (IsVowel(gameObject.Name[0]) ? "an " : "a ") + name;
     else
         return "some " + name;
 }