public Student() { GetInput getStudent = (firstName, lastName, date, tuitionFee) => { while (true) { Console.WriteLine("All Fields Required to be filled\n"); Console.Write("First Name :"); FirstName = Console.ReadLine(); if (!Menu.StringValidation(FirstName)) { continue; } Console.Write("Last Name :"); LastName = Console.ReadLine(); if (!Menu.StringValidation(LastName)) { continue; } Console.Write("Tuition Fee :"); string feeCheck = Console.ReadLine(); if (!Menu.StringValidation(feeCheck)) { continue; } Console.Write("Date of birth :"); string dateCheck = Console.ReadLine(); if (!Menu.DateTimeValidation(dateCheck)) { Console.WriteLine("Wrong Date e.g of correct date(1/1/2001)"); continue; } DateOfBirth = DateTime.Parse(dateCheck); TuitionFee = Convert.ToSingle(feeCheck); break; } }; getStudent(FirstName, LastName, DateOfBirth, TuitionFee); }
string[] ReceiveOutputLines(int timeout) { var output = new List <string>(); while (true) { GetInput.Set(); bool success = GotInput.WaitOne(timeout); if (!success) { throw new DebuggerNotResponsesException(); } if (InputString == null) { return(null); } output.Add(InputString); if (InputString == "(gdb)") { break; } } return(output.ToArray()); }
public Trainer() { GetInput getTrainer = (firstName, lastName, subject) => { while (true) { Console.WriteLine("All Fields Required to be filled\n"); Console.Write("First Name :"); FirstName = Console.ReadLine(); if (!Menu.StringValidation(FirstName)) { continue; } Console.Write("Last Name :"); LastName = Console.ReadLine(); if (!Menu.StringValidation(LastName)) { continue; } Console.Write("Subject :"); Subject = Console.ReadLine(); if (!Menu.StringValidation(Subject)) { continue; } break; } }; getTrainer(FirstName, LastName, Subject); }
void Awake() { if (!_instance) { _instance = this; } }
//Varibles End *************************************************************** // Use this for initialization void Start() { networkManager = GameObject.Find("NetworkManager"); getInput = networkManager.GetComponent<GetInput>(); boardState = networkManager.GetComponent<BoardState>(); animate = networkManager.GetComponent<Animate>(); }
[ServerCallback] // Only run on server. void Update() { if (GetInput.ButtonDown("Reset")) { Left = 0; Right = 0; } }
private void ReaderThread() { while (true) { GetInput.WaitOne(); InputString = DebuggerOutput.ReadLine(); GotInput.Set(); } }
private static void Reader( ) { while (true) { GetInput.WaitOne( ); Input = Console.ReadLine( ); GotInput.Set( ); } }
public void Pass_InvalidCharacter() { bool result = true; IGetInput getInput = new GetInput(); result = getInput.ValidateInput("5x2"); Assert.AreEqual(result, false); }
// Start is called before the first frame update void Start() { levelParent = GameObject.Find("LevelParent"); getInput = levelParent.GetComponent <GetInput>(); //transform.GetComponent<Rigidbody>().AddForce(transform.forward * speed); timer = GameObject.FindWithTag("GameController").GetComponent <Timer>(); camera = transform.GetChild(0).gameObject; SoundEffectsInGame = GameObject.Find("LevelSeletor").GetComponent <SoundEffectsInGame>(); distance = 0.025f; AudioSource = GameObject.Find("LevelSeletor").GetComponent <AudioSource>(); }
public static string ReadLine(int timeout = Timeout.Infinite) { GetInput.Set( ); bool success = GotInput.WaitOne(timeout); if (success) { return(Input); } else { return(null); } }
//Varibles End *********************************************************************************** // Use this for initialization void Start() { //This is so I can access the array and find out what the tile ought to be doing. networkManager = GameObject.Find("NetworkManager"); boardState = networkManager.GetComponent<BoardState>(); getInput = networkManager.GetComponent<GetInput>(); defaultColor = this.renderer.material.color; x = (int)this.transform.position.x / 10; y = (int)this.transform.position.z / 10; //TODO Grab this info from the player / Network colorPlayerOne = Color.red; colorPlayerTwo = Color.blue; }
public async Task PostprocessForGet(int id, GetInput <Home> input, Home result) { if (string.IsNullOrWhiteSpace(result?.Address)) { return; } // Get the people living on the same address. // Normally this would be done with an include of some kind. // We just included this for the sake of the async example. var uow = UnitOfWorkScope.GetUnitOfWork(false); var repository = uow.GetRepository <Person>(); var peopleOnSameAddress = await repository.QueryAsync(x => x.Address == result.Address); result.Habitants = peopleOnSameAddress; }
private void facetToolStripMenuItem_Click(object sender, EventArgs e) { var tempNode = (ElasticNode)treeViewAdv1.SelectedNode.Tag; if (tempNode != null) { var g = new GetInput("", "pls input a fileld name to do Facet,ie: disease.name.not_analyzed"); if (g.ShowDialog() == DialogResult.OK) { int facet_size = 10; var gf = new GetInput("", "pls input size of Facet"); if (gf.ShowDialog() == DialogResult.OK) { if (!gf.Input.ToString().IsNullOrEmpty()) { facet_size = Convert.ToInt32(gf.Input); } } var facets = currentElasticSearchInstance.Search(tempNode.IndexName, new ElasticQuery(new MatchAllQuery(), null, 0, 10) { Facets = new TermsFacet("facet", g.Input, facet_size) }); // WriteLog("facets.Response"); // WriteLog(facets.Response); tempNode.Nodes.Clear();//NOTE var facetNode = new ElasticNode("facets"); tempNode.Nodes.Add(facetNode); if (facets.Facets != null) { foreach (var facet in facets.Facets) { var item = new ElasticNode(facet.Key + "(" + facet.Value.Count + ")"); facetNode.Nodes.Add(item); foreach (var VARIABLE in facet.Value) { item.Nodes.Add(new ElasticNode(VARIABLE.Key + "(" + VARIABLE.Value.ToString() + ")")); } } } } } }
// Use this for initialization void Start() { input = GetComponent<GetInput>(); }
//Varibles End--------------------------------------------------------- //NOTE: Looks like this will run before the board is fully filled causing null refrences. This does not crash the game. //NOTE: Currently I am leaving it as is. This should be fixed later. // Use this for initialization void Start() { networkManager = GameObject.Find("NetworkManager"); boardState = networkManager.GetComponent<BoardState>(); getInput = networkManager.GetComponent<GetInput>(); threatCheckReady = true; // This is just so it will call on startup (threatened tiles) //Here I will go ahead and draw up the game board. //Each tile will be drawn seprately to allow modification and skins. for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) { if (i % 2 == 0) { if (j % 2 == 0) { Instantiate(darkTile, new Vector3(i * 10, 0, j * 10), Quaternion.identity); } else { Instantiate(lightTile, new Vector3(i * 10, 0, j * 10), Quaternion.identity); } } else { if (j % 2 == 0) { Instantiate(lightTile, new Vector3(i * 10, 0, j * 10), Quaternion.identity); } else { Instantiate(darkTile, new Vector3(i * 10, 0, j * 10), Quaternion.identity); } }//Draw the tile }//Draw Loop }
//movement variable descriptions //force from motor // maxTourque (scaling for forward input) // Effeciency (assume 1) // Gear Ratio (1 - 150 some int) // Angular speed (rpms) // Wheel Radius // uphill vs downhill (1 for uphill -1 for downhill) // m =mass // g = 9.8 // Gradient Angle (Gradient alpha) (angle of slope - 0) // //rolling resistance // rolling resistance coeffecient (fr) // wieight // cos(alpha) slope // //drag force // density of air (p=1.21 kg/m^3) // drag coeffecient (cd=1.2) // Area (cross sectional = .004 m^2) // Velocity vector (y) squared magnitude // Lw = car geoemetry = 0.15 //mass m - ydot squared = velocity squared in forward direction //tan(phi) phi is max turning angle (30 degrees) * turning input to get current phi // Use this for initialization void Start() { input = GetComponent<GetInput>(); position.Set (50, 50, 0); motorOutForce = (mTor * effec * gearRatio * angularSpeed/60)/wheelRad; //resistForce = 0; rollingResistForce = rollResist * mass * g * Mathf.Cos (gradAngle); //rollingResistForce = 0; airResistForce = .5f * airDensity * dragCoef * areaCross; centripetalForce = mass / lW; if (isAI) { ItemsAI.updateItems (); PathPlanningKart k = GetComponent<PathPlanningKart> (); k.PathPlanInitialSegment (); MAX_SPEED = MAX_SPEED * .95f; } }
// <summary> // Use this for initialization // </summary> void Start() { startTime = Time.realtimeSinceStartup; input = GetComponent<GetInput> (); //GameObject o = GameObject.Find("Kart " + kartNum); Debug.Log("here"); //Debug.Log("rrr"+o.transform); rb = GetComponent<Rigidbody> (); Debug.Log("rrr" + rb); boost = 1f; fr = GameObject.Find("wcfr "+kartNum).GetComponent<WheelCollider>(); fl = GameObject.Find("wcfl " + kartNum).GetComponent<WheelCollider>(); br = GameObject.Find("wcbr " + kartNum).GetComponent<WheelCollider>(); bl = GameObject.Find("wcbl " + kartNum).GetComponent<WheelCollider>(); fr.enabled = true; fl.enabled = true; br.enabled = true; bl.enabled = true; if (isAI) { ItemsAI.updateItems (); PathPlanningDataStructures.initializePathPlanning (); kartp = GetComponentInChildren<PathPlanningKart> (); kartp.PathPlanInitialSegment (); MAX_SPEED *= .8f; } }
//Varibles End ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Use this for initialization void Start() { networkManager = GameObject.Find("NetworkManager"); getInput = networkManager.GetComponent<GetInput>(); winStyle.fontSize = 180; winStyle.normal.textColor = new Color(200,150,0); winStyle.fontStyle = FontStyle.Bold; winStyle.alignment = TextAnchor.MiddleCenter; promoStyle.fontSize = 30; winStyle.alignment = TextAnchor.MiddleCenter; }
// Use this for initialization void Start() { input = target.GetComponent<GetInput>(); }