public static void getValue(string strgKey, out string strgValue) { strgValue = ""; if (!SettingsSingleton.isExistsStringValue(strgKey)) { //キャッシュになし //DBから読み込む using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); SettingsDAO dao = new SettingsDAO(con); dao.selectSetting(strgKey, out strgValue); con.CloseConnection(); SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue); } } else { //キャッシュにあり //キャッシュの値を返す values v = SettingsSingleton.cache_[strgKey]; strgValue = v.strgValue; } }
private void GenerateDungeon() { map = GenerateArray(width, height, false); int a = width / 2 - Random.Range(MinRoomSize, MaxRoomSize); int b = height / 2 - Random.Range(MinRoomSize, MaxRoomSize); int offset = Random.Range(MinRoomSize, MaxRoomSize); values val = new values(a, b, a + offset, b + offset); // place player in the middle of the first room GameObject start_location = (GameObject)Instantiate(playerStart); int x = b + (offset / 2); int y = a + (offset / 2); start_location.transform.position = new Vector3Int(-x + width / 2 + 1, -y + height / 2 + 1, 0); for (int i = 0; i < rooms; i++) { create_room(val); if (i != rooms - 1) { val = create_corridor(val); } } GameObject exit_location = (GameObject)Instantiate(exit); int y_exit = (val.topLx + val.botRx) / 2; int x_exit = (val.botRy + val.topLy) / 2; exit_location.transform.position = new Vector3Int(-x_exit + width / 2 + 1, -y_exit + height / 2 + 1, 0); }
public static bool isExistsIntValue(string strgKey) { Dictionary <string, values> c = SettingsSingleton.cache_; if (c.ContainsKey(strgKey)) { values v = c[strgKey]; if (v != null) { if (v.intValue != Int32.MinValue) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }
public ActionResult DeleteConfirmed(Guid id) { values values = db.values.Find(id); db.values.Remove(values); db.SaveChanges(); return(RedirectToAction("Index")); }
public GameItem(WpfApplication19.Presenters.GameManger gamingManager, int XPosition, int YPosition) : base(gamingManager, XPosition, YPosition) { Value = values.Empty; setValueCommand = new DorCommand((param) => DoSomething(), (() => true)); _isPartOfWinner = false; IsEnabled = true; }
private void ShowPhoneNo(object sender, ItemTappedEventArgs e) { if (LeftCarousel.Position == 0) { ListView l = (ListView)sender; values v = (values)l.SelectedItem; DisplayAlert("Contact Number", v.phoneno, "OK"); } }
public ActionResult Edit([Bind(Include = "valueId,valueName,valueDescription,valueIcon,valueWeight")] values values) { if (ModelState.IsValid) { db.Entry(values).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(values)); }
private void create_room(values val) { for (int i = val.topLy; i < val.botRy; i++) { for (int j = val.topLx; j < val.botRx; j++) { map[i, j] = 0; } } }
//2 //public readonly static int test = 10; //public const int test_const = 20; private void button1_Click(object sender, EventArgs e) { // test = 11;//присваивание значение доступному только для чтения статическому полю допускается только с статическом конструкторе или в инициализаторе переменных // test_const = 21;//левая часть выражения должна быть переменной, свойством или индексатором variableKey key = new variableKey(); values Eleven = new values(12); label1.Text = Eleven.GetValue(key.KeyInteger()); button1.Text = Eleven.GetValue(key.KeyString()); }
public ActionResult Create([Bind(Include = "valueId,valueName,valueDescription,valueIcon,valueWeight")] values values) { if (ModelState.IsValid) { values.valueId = Guid.NewGuid(); db.values.Add(values); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(values)); }
static void Main() { values newval = new values(); newval[3] = 58; newval[5] = 60; for (int i = 0; i < 10; i++) { System.Console.WriteLine("Element #{0} = {1}", i, newval[i]); } System.Console.WriteLine("Press any key to exit."); System.Console.ReadKey(); }
private values[,] ReturnMatrixFromArray() { values[,] toReturn = new values[3, 3]; for (int i = 0; i < 3; i++) { ObservableCollection <GameItem> listOfitems = ArrayOfRows[i].Items; for (int j = 0; j < 3; j++) { toReturn[i, j] = listOfitems[j].Value; } } return(toReturn); }
public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } values values = db.values.Find(id); if (values == null) { return(HttpNotFound()); } return(View(values)); }
public static bool isEqualsIntValue(values v, int intValue) { if (v != null) { if (v.intValue == intValue) { return(true); } else { return(false); } } else { return(false); } }
public static bool isEqualsStringValue(values v, string strgValue) { if (v != null) { if (v.strgValue.Equals(strgValue)) { return(true); } else { return(false); } } else { return(false); } }
private values create_corridor(values val) { int dir = Random.Range(0, 4); values new_val = new values(); // generate new coords for next room int new_len = Random.Range(MinRoomSize, MaxRoomSize); int new_hght = Random.Range(MinRoomSize, MaxRoomSize); int entry_offset = Random.Range(0, new_len); int corr_length = Random.Range(MinCorrSize, MaxCorrSize); switch (dir) { case 0: { // north //cout << "north" << endl; new_val = northCorridor(val, new_len, new_hght, entry_offset, corr_length); break; } case 1: { // east //cout << "east" << endl; new_val = eastCorridor(val, new_len, new_hght, entry_offset, corr_length); break; } case 2: { // south //cout << "south" << endl; new_val = southCorridor(val, new_len, new_hght, entry_offset, corr_length); break; } case 3: { // west //cout << "west" << endl; new_val = westCorridor(val, new_len, new_hght, entry_offset, corr_length); break; } } return(new_val); }
public void rando(values valu = values.integer, int min = 0, int max = 65535) { Random a = new Random(); for (int i = 0; i < name.ColumnCount; i++) { for (int j = 0; j < name.RowCount; j++) { if (valu == values.integer) { name.Rows[j].Cells[i].Value = a.Next(min, max); } else { name.Rows[j].Cells[i].Value = a.NextDouble() * (max - min) + min; } } } name.AutoResizeColumns(); }
private values southCorridor(values val, int new_len, int new_hght, int entry_offset, int corr_length) { int X = Random.Range(val.topLx + 1, val.botRx); int startY = val.botRy; // if room is out of bounds if (X - entry_offset <= 0 || startY + corr_length <= 0 || X - entry_offset + new_len >= width - 1 || startY + corr_length + new_hght >= height - 1) { return(create_corridor(val)); } // draw corridor for (int i = 0; i < corr_length + MinRoomSize; i++) { map[startY + i, X] = 0; map[startY + i, X + 1] = 0; } return(new values(X - entry_offset, startY + corr_length, X - entry_offset + new_len, startY + corr_length + new_hght)); }
private values westCorridor(values val, int new_len, int new_hght, int entry_offset, int corr_length) { int Y = Random.Range(val.topLy + 1, val.botRy); int startX = val.topLx; // if room is out of bounds if (startX - corr_length - new_len <= 0 || Y + entry_offset - new_hght <= 0 || startX - corr_length >= width - 1 || Y + entry_offset >= height - 1) { return(create_corridor(val)); } // draw corridor for (int i = 0; i < corr_length + MinRoomSize; i++) { map[Y, startX - i - 1] = 0; map[Y + 1, startX - i - 1] = 0; } return(new values(startX - corr_length - new_len, Y + entry_offset - new_hght, startX - corr_length, Y + entry_offset)); }
public static void getValue(DAOContext con, string strgKey, out string strgValue) { strgValue = ""; if (!SettingsSingleton.isExistsStringValue(strgKey)) { //キャッシュになし //DBから読み込む SettingsDAO dao = new SettingsDAO(con); dao.selectSetting(strgKey, out strgValue); SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue); } else { //キャッシュにあり //キャッシュの値を返す values v = SettingsSingleton.cache_[strgKey]; strgValue = v.strgValue; } }
public static void getValue(DAOContext con, string strgKey, out int intValue) { intValue = 0; if (!SettingsSingleton.isExistsIntValue(strgKey)) { //キャッシュになし //DBから読み込む SettingsDAO dao = new SettingsDAO(con); dao.selectSetting(strgKey, out intValue); SettingsSingleton.cache_[strgKey] = new values(intValue, null); } else { //キャッシュにあり //キャッシュの値を返す values v = SettingsSingleton.cache_[strgKey]; intValue = v.intValue; } }
IEnumerator PollData() { string url = "http://22950.hosts.ma-cloud.nl/bewijzenmap/test/drawing.json"; WWW www = new WWW(url); //yield return www; //values obj = JsonUtility.FromJson<values>(www.text); // Debug.Log("x: " + obj.x + ", y: " + obj.y + ", width: " + obj.width + ", height: " + obj.height); while (!www.isDone) { // values obj = JsonUtility.FromJson<values>(www.text); // Debug.Log("x: " + obj.x + ", y: " + obj.y + ", width: " + obj.width + ", height: " + obj.height); yield return(null); } FaceValues = JsonUtility.FromJson <values>(www.text); FindObjectOfType <InstantiateCollider>().UpdateTransform(FaceValues.x, FaceValues.y, FaceValues.width, FaceValues.height); Debug.Log("x: " + FaceValues.x + ", y: " + FaceValues.y + ", width: " + FaceValues.width + ", height: " + FaceValues.height); yield return(new WaitForSeconds(waitSeconds)); StopAllCoroutines(); StartCoroutine(PollData()); }
/// <summary> /// Add encoding to the encoding table. /// </summary> /// <param name="codepage">Codepage.</param> /// <param name="desc">Desciption.</param> /// <param name="encoding">Encoding.</param> public static void Add(int codepage, string desc, Encoding encoding) { mDebugger.SendInternal($"Adding codepage {codepage} desc {desc}"); CodepageCache[codepage] = new values(desc, encoding); }
{{{Each(values, byLength => $@"
ConvertCore(values, result, this.MaximumValue);
iter(values, kvp => properties.TryFind(kvp.name) .OnSome(p => p.SetValue(element, parse(p.PropertyType, kvp.value))));
static void Main() { int score = Convert.ToInt32(Console.ReadLine()); List <values> listofValues = new List <values>(); int d = 0; for (int i = 1; i < 21; i++) { values v = new values(i, ("single " + (i).ToString())); listofValues.Add(v); } for (int i = 11; i < 21; i++) { values v = new values((i * 2), ("double " + (i).ToString())); listofValues.Add(v); } for (int i = 7; i < 21; i++) { if (i != 8 && i != 10 && i != 12) { values v = new values((i * 3), ("triple " + (i).ToString())); listofValues.Add(v); } } int a = 42, b = 42, c = 42; while (a == 42) { for (int x = 0; x < 41; x++) { for (int y = 0; y < 41; y++) { for (int z = 0; z < 41; z++) { int ps = listofValues[x].val + listofValues[y].val + listofValues[z].val; if (ps == score) { a = x; b = y; c = z; } } } } break; } if (a == 42) { if (score == 1) { Console.WriteLine("single 1"); } else if (score == 2) { Console.WriteLine("single 2"); } else { Console.WriteLine("impossible"); } } else { Console.WriteLine(listofValues[a].str); Console.WriteLine(listofValues[b].str); Console.WriteLine(listofValues[c].str); } }
RandomInternal(values, count, random);
private void DoSomething() { Value = theGameManger.getNextValue(); theGameManger.lastValueUsed = Value; }
return(new ContinuedFractionBigInt(values, triples[(m, d, a)]));
private values[,] ReturnMatrixFromArray() { values[,] toReturn = new values[3, 3]; for (int i = 0; i < 3; i++) { ObservableCollection<GameItem> listOfitems = ArrayOfRows[i].Items; for (int j = 0; j < 3; j++) { toReturn[i, j] = listOfitems[j].Value; } } return toReturn; }
ConvertToDataView(env, keys, values, treatValuesAsKeyTypes), KeyColumnName, ValueColumnName, columns)