Show / Hide Table of Contents

Class WorldLayerNeighborInfo

This struct provides on demand values for all neighbor cells around the Eco.Simulation.WorldLayers.WorldLayerNeighborInfo.cell (3x3 matrix with the cell in the center). It may be used by interactions which requires neighbors info (i.e. for values spreading).

Inheritance
System.Object
WorldLayerNeighborInfo
Namespace: Eco.Simulation.WorldLayers
Assembly: Eco.Simulation.dll
Syntax
public sealed class WorldLayerNeighborInfo : ValueType

Constructors

WorldLayerNeighborInfo(WorldArea, IWorldLayerView, Boolean)

Use poolArray only in case if you are going to Dispose this object after using

Declaration
public WorldLayerNeighborInfo(WorldArea cell, IWorldLayerView layer, bool poolArray = false)
Parameters
Type Name Description
WorldArea cell
IWorldLayerView layer
System.Boolean poolArray

WorldLayerNeighborInfo(Single[])

Declaration
public WorldLayerNeighborInfo(float[] data)
Parameters
Type Name Description
System.Single[] data

Properties

Neighborhood

The values of the corresponding layer in the 8 adjacent layer cells (plus this center one). Arranged geometrically from least to most x and y, e.g. Neighborhood[0, 2] is the adjacent cell with a smaller x and a larger y coordinate.

Declaration
public float[] Neighborhood { get; }
Property Value
Type Description
System.Single[]

Methods

Dispose()

Declaration
public void Dispose()

PosToArrIndex(Int32, Int32)

Declaration
public static int PosToArrIndex(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
System.Int32
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾