public void SetUp() { _systemContainer = Substitute.For <ISystemContainer>(); _prototypeSystem = Substitute.For <IPrototypeSystem>(); _systemContainer.PrototypeSystem = _prototypeSystem; _executor = new EntityCommandExecutor(); _defaultCell = Substitute.For <IEntity>(); _defaultCell.Has <Physical>().ReturnsForAnyArgs(true); _defaultCell.Has <Appearance>().ReturnsForAnyArgs(true); _map = new Map(MAP_KEY, _defaultCell); }
private List <IEntity> GetEntitiesForMapGenCommands(ISystemContainer systemContainer, List <MapGenCommand> commands) { var entityCommandEntities = commands .Where(c => c.MapGenCommandType == MapGenCommandType.Entity) .Select(c => EntityCommandExecutor.GetEntityName(c, out _)) .Select(entityName => systemContainer.PrototypeSystem.GetPrototype(entityName)) .ToList(); var otherCommandEntities = commands .Where(c => c.MapGenCommandType != MapGenCommandType.Entity) .Select(c => c.MapGenCommandType) .Select(c => systemContainer.EntityEngine.AllEntities.Single(e => e.Has <MapGenerationCommand>() && e.Get <MapGenerationCommand>().Command == c)) .ToList(); entityCommandEntities.AddRange(otherCommandEntities); return(entityCommandEntities); }