예제 #1
0
        /// <summary>
        /// Move an entity out of this' named container
        /// </summary>
        /// <param name="thing">the entity</param>
        /// <param name="containerName">the name of the container</param>
        /// <returns>errors</returns>
        public bool MoveFrom(IPersona thing)
        {
            if (!PersonaInventory.Contains(thing))
            {
                return(false);
            }

            PersonaInventory.Remove(thing);
            thing.Position = null;
            UpsertToLiveWorldCache();

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Move an entity into a named container in this
        /// </summary>
        /// <param name="thing">the entity to add</param>
        /// <returns>errors</returns>
        public bool MoveInto(IPersona thing)
        {
            if (PersonaInventory.Contains(thing))
            {
                return(false);
            }

            PersonaInventory.Add(thing);
            thing.Position = this;
            thing.Save();
            Save();

            return(true);
        }
예제 #3
0
 /// <summary>
 /// Get all of the entities matching a type inside this
 /// </summary>
 /// <returns>the contained entities</returns>
 public IEnumerable <IPersona> GetPersonas()
 {
     return(PersonaInventory.Contents());
 }