Пример #1
0
        /// <summary>
        /// Add an exit blueprint to the pipeline. These blueprints are called
        /// at the end of the chain after all regular blueprints. They receive
        /// a fully constructed object and are the final chance to  alter the
        ///  result of an object.
        /// </summary>
        /// <param name="blueprint"></param>
        /// <returns></returns>
        public Construktion Apply(ExitBlueprint blueprint)
        {
            blueprint = blueprint ?? throw new ArgumentNullException(nameof(blueprint));

            apply(x => x.Apply(blueprint));
            return(this);
        }
Пример #2
0
 public Exit(ExitBlueprint blueprint, IRoom destination)
 {
     Name         = blueprint.Keyword;
     Keywords     = Name?.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries) ?? Enumerable.Empty <string>();
     Description  = blueprint.Description;
     Destination  = destination;
     Blueprint    = blueprint;
     CurrentFlags = Blueprint.Flags;
 }
Пример #3
0
        public IExit AddExit(IRoom from, IRoom to, ExitBlueprint blueprint, ExitDirections direction)
        {
            if (blueprint == null)
            {
                throw new ArgumentNullException(nameof(blueprint));
            }
            Exit from2To = new Exit(blueprint, to);

            from.Exits[(int)direction] = from2To;
            return(from2To);
        }
Пример #4
0
 public IExit AddExit(IRoom from, IRoom to, ExitBlueprint blueprint, ExitDirections direction)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 /// <summary>
 /// Add an exit blueprint to the pipeline. These blueprints are called
 /// at the end of the chain after all regular blueprints. They receive
 /// a fully constructed object and are the final chance to  alter the
 ///  result of an object.
 /// </summary>
 public ConstruktionRegistry AddExitBlueprint(ExitBlueprint blueprint)
 {
     _settings.Apply(blueprint);
     return(this);
 }
Пример #6
0
 public void Apply(ExitBlueprint exitBlueprint) => _exitBlueprints.Add(exitBlueprint);