public void LoadParameters() { walTile = MapProperties.wallTile; groundTile = MapProperties.groundTile; burnedGroundTile = MapProperties.burnedGroundTile; generationType = MapProperties.worldGenerationType; wallsHealth = MapProperties.wallsHealth; _newGenProperties.wallChance = MapProperties.wallChance; _newGenProperties.filled = MapProperties.filled; _newGenProperties.empty = MapProperties.empty; _newGenProperties.repeatCount = MapProperties.repeatCount; _newGenProperties.tileMapSize = MapProperties.tileMapSize; Enemies = MapProperties.Enemies; enemyAmount = MapProperties.enemyAmount; _oldGenProperties.TileAmount = MapProperties.tileAmount; TileSize = 1; _oldGenProperties.chanceUp = MapProperties.chanceUp; _oldGenProperties.chanceRight = MapProperties.chanceRight; _oldGenProperties.chanceDown = MapProperties.chanceDown; _oldGenProperties.ExtraWallsX = MapProperties.ExtraWallsX; _oldGenProperties.ExtraWallsY = MapProperties.ExtraWallsY; ObjectsSpawner = MapProperties.spawner; if (ObjectsSpawner.Count != 0) { for (int i = 0; i < MapProperties.spawner.Count; i++) { if (ObjectsSpawner[i].enableSpawner) { objToSpawn spawner = ObjectsSpawner[i]; if (!string.IsNullOrEmpty(spawner._tileMapName)) { spawner._Map = GameObject.Find(spawner._tileMapName).GetComponent <Tilemap>(); if (spawner._Map) { ObjectsSpawner[i] = spawner; } } } } } advanceSurfacesSettings = new List <advancedSurface>(); advanceSurfacesSettings = MapProperties.extraSurface; for (int k = 0; k < advanceSurfacesSettings.Count; k++) { if (advanceSurfacesSettings[k].enableSurface) { advancedSurface s = new advancedSurface(); s = advanceSurfacesSettings[k]; if (!s._Map) { s._Map = GameObject.Find(s._tileMapName).GetComponent <Tilemap>(); advanceSurfacesSettings[k] = s; } } } }
/// <summary> /// Returns the linear blend of x and y, i.e. x /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="a"></param> /// <returns></returns> protected genType mix(genType x, genType y, float a) { throw new NotImplementedException(); }
/// <summary> /// Arc tangent. Returns an angle whose tangent is y/x. The /// signs of x and y are used to determine what quadrant the /// angle is in. /// </summary> /// <param name="y"></param> /// <param name="x"></param> /// <returns></returns> protected genType atan(genType y, genType x) { throw new NotImplementedException(); }
/// <summary> /// Converts radians to degrees, /// </summary> /// <param name="radians"></param> /// <returns></returns> protected genType degrees(genType radians) { throw new NotImplementedException(); }
/// <summary> /// Arc cosine. Returns an angle whose cosine is x. /// </summary> /// <param name="x"></param> /// <returns></returns> protected genType acos(genType x) { throw new NotImplementedException(); }
/// <summary> /// Returns the base 2 logarithm of x /// </summary> /// <param name="x"></param> /// <returns></returns> protected genType log2(genType x) { throw new NotImplementedException(); }
/// <summary> /// <summary> /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and /// performs smooth Hermite interpolation between 0 and 1 /// when edge0 < x < edge1. This is useful in cases where /// you would want a threshold function with a smooth /// transition. This is equivalent to: /// genType t; /// t = clamp ((x – edge0) / (edge1 – edge0), 0, 1); /// return t * t * (3 – 2 * t); /// Results are undefined if edge0 >= edge1. /// </summary> /// </summary> protected genType smoothstep(float edge0, float edge1, genType x) { throw new NotImplementedException(); }
public vec3(genType x, genType y, genType z) { throw new NotImplementedException(); }
/// <summary> /// Returns the length of vector x, /// </summary> /// <param name="x"></param> /// <returns></returns> protected float length(genType x) { throw new NotImplementedException(); }
/// <summary> /// Modulus (modulo). Returns x – y * floor (x/y) /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public genType mod(genType x, float y) { throw new NotImplementedException(); }
/// <summary> /// Returns a value equal to the nearest integer that is less than or equal to x /// </summary> public genType floor(genType x) { throw new NotImplementedException(); }
protected genType inversesqrt(genType x) { throw new NotImplementedException(); }
public __vec2(genType x, genType y) { this._x = x; this._y = y; }
/// <summary> /// Modulus. Returns x – y * floor (x/y) /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected genType mod(genType x, genType y) { throw new NotImplementedException(); }
/// <summary> /// Returns the distance between p0 and p1, /// </summary> /// <param name="p0"></param> /// <param name="p1"></param> /// <returns></returns> protected float distance(genType p0, genType p1) { throw new NotImplementedException(); }
/// <summary> /// Returns the dot product of x and y, /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected float dot(genType x, genType y) { throw new NotImplementedException(); }
/// <summary> /// Modulus (modulo). Returns x – y * floor (x/y) /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected genType mod(genType x, float y) { throw new NotImplementedException(); }
/// <summary> /// Returns a vector in the same direction as x but with a /// length of 1. /// </summary> /// <param name="x"></param> /// <returns></returns> protected genType normalize(genType x) { throw new NotImplementedException(); }
/// <summary> /// If dot(Nref, I) < 0 return N, otherwise return –N. /// </summary> /// <param name="N"></param> /// <param name="I"></param> /// <param name="Nref"></param> /// <returns></returns> protected genType faceforward(genType N, genType I, genType Nref) { throw new NotImplementedException(); }
//-------------------------------------------------- private void expSingleGeneration_Expanded(object sender, RoutedEventArgs e) { if (!initializeComponentIsCompleted) return; if (disableExpandersEvents) return; disableExpandersEvents = true; if (lockExpanders) { expSingleGeneration.IsExpanded = false; disableExpandersEvents = false; return; } lastExpanded_GenType = genType.Single; if (expPassword.IsExpanded == false && expWPA.IsExpanded == false) switch (lastExpanded_PswType) { case pswType.Password: expPassword.IsExpanded = true; break; case pswType.WPA: expWPA.IsExpanded = true; break; } expBulkGeneration.IsExpanded = false; expCmdline.IsExpanded = false; expAbout.IsExpanded = false; disableExpandersEvents = false; }
/// <summary> /// For the incident vector I and surface orientation N, /// returns the reflection direction: /// I – 2 * dot(N, I) * N /// N must already be normalized in order to achieve the /// desired result. /// </summary> /// <param name="I"></param> /// <param name="N"></param> /// <returns></returns> protected genType reflect(genType I, genType N) { throw new NotImplementedException(); }
/// <summary> /// The standard trigonometric tangent. /// </summary> /// <param name="angle"></param> /// <returns></returns> protected genType tan(genType angle) { throw new NotImplementedException(); }
/// <summary> /// For the incident vector I and surface normal N, and the /// ratio of indices of refraction eta, return the refraction /// vector. /// </summary> /// <param name="I"></param> /// <param name="N"></param> /// <param name="eta"></param> /// <returns></returns> protected genType refract(genType I, genType N, float eta) { throw new NotImplementedException(); }
/// <summary> /// Returns min (max (x, minVal), maxVal) /// Results are undefined if minVal > maxVal. /// </summary> /// <param name="x"></param> /// <param name="minVal"></param> /// <param name="maxVal"></param> /// <returns></returns> protected genType clamp(genType x, float minVal, float maxVal) { throw new NotImplementedException(); }
public __vec3(genType x, genType y, genType z) { this._x = x; this._y = y; this._z = z; }
/// <summary> /// Returns 0.0 if x < edge, otherwise it returns 1.0 /// </summary> /// <param name="edge0"></param> /// <param name="edge1"></param> /// <param name="x"></param> /// <returns></returns> protected genType step(float edge, genType x) { throw new NotImplementedException(); }
/// <summary> /// dFdx, dFdy — return the partial derivative of an argument with respect to x or y /// </summary> /// <param name="p"></param> /// <returns></returns> protected genType dFdy(genType p) { throw new NotImplementedException(); }
/// <summary> /// Returns y if y < x, otherwise it returns x /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected genType min(genType x, float y) { throw new NotImplementedException(); }
/// <summary> /// Returns x raised to the y power /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> protected genType pow(genType x, genType y) { throw new NotImplementedException(); }
public __ivec3(genType x, genType y, genType z) { this._x = x; this._y = y; this._z = z; }
/// <summary> /// Arc tangent. Returns an angle whose tangent is /// y_over_x. /// </summary> /// <param name="y_over_x"></param> /// <returns></returns> protected genType atan(genType y_over_x) { throw new NotImplementedException(); }
//-------------------------------------------------- public void PrepareToGeneration(genType gt, pswType pt, ref PasswordGenerator pg) { PasswordGenerator.PasswordGenerationOptions pgo = new PasswordGenerator.PasswordGenerationOptions(); // options switch (gt) { case genType.Single: pgo.easyToType = (bool)chkSingle_EasyToType.IsChecked; pgo.excludeConfusing = (bool)chkSingle_ExcludeConfusingChars.IsChecked; pgo.quantity = 1; break; case genType.Bulk: pgo.easyToType = (bool)chkBulkEasyToType.IsChecked; pgo.excludeConfusing = (bool)chkBulkExcludeConfusingChars.IsChecked; pgo.quantity = udBulkQuantity.Value ?? 0; fileName = txtBulkFile.Text; appendToFile = rbBulkAppend.IsChecked ?? true; break; default: pgo.pswLength = 0; // mark structure as invalid return; // error } // fill the pgo.charsets array pgo.charsets = new string[0]; switch (pt) { case pswType.Password: pgo.pswLength = udPswLength.Value ?? 0; // search for all checkboxes in the expPassword expander foreach (object ctrl in FindAllChildren(expPassword)) if (ctrl.GetType().Name == "CheckBox" && (bool)((CheckBox)ctrl).IsChecked && ((CheckBox)ctrl).Tag != null) { Array.Resize(ref pgo.charsets, pgo.charsets.Length + 1); pgo.charsets[pgo.charsets.Length - 1] = (string)((CheckBox)ctrl).Tag; } // user defined charset if ((bool)chkPswUserDefinedCharacters.IsChecked) pgo.userDefinedCharset = txtPswUserDefinedCharacters.Text; break; case pswType.WPA: if ((bool)rbWpaPassphrase.IsChecked) { pgo.pswLength = udWpaLength.Value ?? 0; // search for all checkboxes in the expWPA expander foreach (object ctrl in FindAllChildren(expWPA)) if (ctrl.GetType().Name == "CheckBox" && (bool)((CheckBox)ctrl).IsChecked && ((CheckBox)ctrl).Tag != null) { Array.Resize(ref pgo.charsets, pgo.charsets.Length + 1); pgo.charsets[pgo.charsets.Length - 1] = (string)((CheckBox)ctrl).Tag; } // user defined charset if ((bool)chkWpaUserDefinedCharacters.IsChecked) pgo.userDefinedCharset = txtWpaUserDefinedCharacters.Text; } else // rbWpa256bitKey is checked { pgo.pswLength = 64; // use only one charset pgo.charsets = new string[1]; pgo.charsets[0] = "hex"; } break; default: pgo.pswLength = 0; return; // some error } pg = new PasswordGenerator(pgo); // create and initialize the password generator class }