public EPropsDesignBodyChangesListener(EPropElevationManager elevationManager, Repositioner repositioner)
 {
     _elevationManager             = elevationManager;
     _repositioner                 = repositioner;
     _spotIdToElevationIdDict      = new Dictionary <SpotId, EPropElevationPointer>();
     _spotIdToGroupElevationIdDict = new Dictionary <SpotId, List <EPropElevationPointer> >();
 }
 public GRingTripletProvider(MyRectangle inGamePosition, Repositioner repositioner,
                             HeightDenormalizer heightDenormalizer)
 {
     this._inGamePosition = inGamePosition;
     _repositioner        = repositioner;
     _heightDenormalizer  = heightDenormalizer;
 }
Exemple #3
0
    public BattleStageSide GetRepositionedSurvivors()
    {
        IEnumerable <BattalionState> survivors = units.Where(item => item.IsAlive);

        if (!survivors.Any())
        {
            throw new InvalidOperationException("Can't get repositioned survivors if there are no survivors");
        }

        Repositioner        currentRepositioner  = new Repositioner(survivors.ToList());
        List <Repositioner> repositioningHistory = new List <Repositioner>()
        {
            currentRepositioner
        };

        while (currentRepositioner.RepositioningHappend)
        {
            if (repositioningHistory.Count < RepositioningLimit)
            {
                throw new Exception("Repositioning limit exceeded. Probably headed for an infinit loop");
            }
            currentRepositioner = currentRepositioner.GetNext();
            repositioningHistory.Add(currentRepositioner);
        }
        return(currentRepositioner.ToBattleSide());
    }
Exemple #4
0
        private Repositioner _providerGenerationRepositioner; //TODO why we must use repositioner?

        public GrassGroupsGrower(GrassGroupsPlanter grassGroupsPlanter,
                                 IGrassIntensityMapProvider grassIntensityMapProvider, List <GrassType> supportedGrassTypes, Repositioner providerGenerationRepositioner)
        {
            _grassGroupsPlanter             = grassGroupsPlanter;
            _grassIntensityMapProvider      = grassIntensityMapProvider;
            _supportedGrassTypes            = supportedGrassTypes;
            _providerGenerationRepositioner = providerGenerationRepositioner;
        }
Exemple #5
0
        public static FovData FromCamera(Camera camera, Repositioner repositioner = null)
        {
            var lastPosition = camera.transform.position;

            var newPosition = new Vector3(lastPosition.x, 1, lastPosition.z);

            if (repositioner != null)
            {
                newPosition = repositioner.InvMove(newPosition);
            }
            camera.transform.position = newPosition;
            var data = new FovData(camera.transform.position, GeometryUtility.CalculateFrustumPlanes(camera));

            camera.transform.position = lastPosition;
            return(data);
        }
 public GrassGroupsPlanter(
     GrassDetailInstancer grassDetailInstancer,
     IGrassPositionResolver positionResolver,
     GrassGroupsContainer groupsContainer,
     IDesignBodyChangesListener designBodiesChangeListener,
     IGrass2AspectsGenerator aspectsGenerator,
     Dictionary <GrassType, GrassTypeTemplate> templatesDictionary, Repositioner repositioner)
 {
     _grassDetailInstancer       = grassDetailInstancer;
     _positionResolver           = positionResolver;
     _groupsContainer            = groupsContainer;
     _designBodiesChangeListener = designBodiesChangeListener;
     _templatesDictionary        = templatesDictionary;
     _repositioner     = repositioner;
     _aspectsGenerator = aspectsGenerator;
 }
Exemple #7
0
        public static FovData FromCamera(ICameraForUpdate camera, Repositioner repositioner = null)
        {
            var lastPosition = camera.Position;

            var newPosition = new Vector3(lastPosition.x, 1, lastPosition.z);

            if (repositioner != null)
            {
                newPosition = repositioner.InvMove(newPosition);
            }
            camera.Position = newPosition;
            //BoundDebugging.SetCamera(camera);
            var data = new FovData(camera.Position, camera.CalculateFrustumPlanes(camera));

            camera.Position = lastPosition;
            return(data);
        }
 public VegetationDatabasePrecomputationConfiguration(Repositioner repositioner,
                                                      HeightDenormalizer heightDenormalizer)
 {
     _repositioner = repositioner;
     _biomeProvidersConfiguration = new BiomeProvidersConfiguration(heightDenormalizer);
 }