public double this[int index, EnType type = EnType.FuncValue] { get { if (type == EnType.Value) { return(x[index]); } if (type == EnType.FuncValue) { return(psi[index]); } return(0.0); } set { if (type == EnType.Value) { x[index] = value; } if (type == EnType.FuncValue) { psi[index] = value; } } }
public EnergyTrail(Vector2Int gridPos, EnType type, Direction direction, Energy creator) { this.gridPos = gridPos; this.type = type; this.direction = direction; energy = creator; }
protected List <EnType> affectingEnergies; // Types of energies that affect this energy public Energy(EnType type, Vector2Int gridPos) { energyType = type; this.gridPos = gridPos; trails = new List <EnergyTrail>(); affectingEnergies = new List <EnType>(); canInfluenceSameType = true; }
public ITypeFac ConvertType(EnType type) { switch (type) { case EnType.dataGrid: return(new CreTypeDataGrid()); case EnType.table: return(new CreTypeTable()); default: throw new Exception(); } }
/// <summary> /// Creates the mutation from field /// </summary> /// <param name="field"> /// The field description /// </param> /// <param name="type"> /// The mutation type /// </param> /// <param name="path"> /// The path to the mutation container. /// </param> /// <returns> /// The new mutation description /// </returns> public static ApiMutation CreateFromField(ApiField field, EnType type, List <ApiRequest> path) { return(new ApiMutation(field.Name, field.Flags) { Arguments = new List <ApiField>(field.Arguments), Description = field.Description, ScalarType = field.ScalarType, TypeName = field.TypeName, Type = type, AuthorizationRules = field.AuthorizationRules, LogAccessRules = field.LogAccessRules, RequireAuthenticatedSession = field.RequireAuthenticatedSession, RequireAuthenticatedUserSession = field.RequireAuthenticatedUserSession, Path = path }); }