public void TestNotCute(Girl notCuteGirl) { Cute cute = new Cute(notCuteGirl); _output.WriteLine("Running not cute test for girl: " + notCuteGirl); Assert.False(cute.IsCute(), "Girl is actually cute:\n" + notCuteGirl); }
void OnTriggerEnter2D(Collider2D collider) { Girl girl = collider.GetComponent <Girl> (); if (girl != null) { //LevelController.levelController.decreaseAntidoteNumber (); girl.scream(); if (!LevelController.levelController.hasAntidote()) { girl.setDead(true); } else { girl.hurtAnimation(); } } Boy boy = collider.GetComponent <Boy> (); if (boy != null) { //LevelController.levelController.decreaseAntidoteNumber (); boy.hurt(); boy.setDead(true); } }
// Use this for initialization void Awake() { light = GetComponent <Light>(); sphereCollider = GetComponent <SphereCollider>(); sphereCollider.radius = light.range; kira = GameObject.FindObjectOfType <Girl>(); }
public FileResult Image(int girlId, int albumId, int index) { var imageUrl = Girl.GetImageUrl(girlId.ToString(), albumId.ToString(), index); var stream = _client.GetStream(imageUrl); return(File(stream, "image/jpeg", $"{girlId}-{albumId}-{index}.jpg")); }
public void get_first_girl() { var girls = new[] { new Girl() { Age = 10 }, new Girl() { Age = 20 }, new Girl() { Age = 30 }, }; var girl = JoeyFirst(girls); var expected = new Girl { Age = 10 }; expected.ToExpectedObject().ShouldEqual(girl); }
public async Task <IHttpActionResult> RetrieveGifts(int girlId, string occassion) { try { // Pull the girl information from the database. Girl girl = db.Girls.Find(girlId); if (girl is null) { return(BadRequest($"A girl with the Id {girlId} does not exist.")); } AmazonConsumer consumer = new AmazonConsumer(); // Generate the search queries. List <string> queries = girl.GetGiftSearchQueries(occassion); List <SearchResult> results = new List <SearchResult>(); foreach (string query in queries) { // No more than 30 results from each query. // Also don't want to add duplicate entries from amazon. List <SearchResult> queryResults = consumer.Search(query); IEnumerable <SearchResult> uniqueQueryResults = queryResults.Where(qr => !results.Exists(r => r.AmazonId == qr.AmazonId)) .Take(MAX_QUERY_RESULTS); results.AddRange(uniqueQueryResults); } return(Ok(await GiftComparer.GetHighestRatedGifts(girl.GetRandomImage(), results, NUM_GIFTS))); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void no_girls() { var girls = new Girl[] { }; TestDelegate action = () => JoeySingle(girls); Assert.Throws <InvalidOperationException>(action); }
public bool UpdateGirl(Girl girl) { try { bool res = false; con.Open(); NpgsqlCommand command = new NpgsqlCommand($"UPDATE girls SET fullname = @fullname, age = @age, hair = @hair, eyes = @eyes WHERE girl_id = {girl.Id}", con); command.Parameters.AddWithValue("@fullname", girl.Fullname); command.Parameters.AddWithValue("@age", girl.Age); command.Parameters.AddWithValue("@hair", girl.Hair); command.Parameters.AddWithValue("@eyes", girl.Eyes); if (command.ExecuteNonQuery() != 0) { res = true; } con.Close(); return(res); } catch { return(false); } }
public void SetGirl(Girl girl, Room room) { Vector3 centerOfRoom = room.transform.position; centerOfRoom.z = -1; switch (room.GetCountOfPersons()) { case 1: centerOfRoom.x -= 0.6f; break; case 2: centerOfRoom.x += 0.6f; break; case 3: centerOfRoom.y -= 0.6f; break; case 4: centerOfRoom.y += 0.6f; break; } girl.transform.position = centerOfRoom; }
public custom_class_example() { Girl ana = new Girl("Ana"); Girl kelsey = new Girl("Kelsey", 19); Girl meghan = new Girl("Meghan", 21); Girl[] array = new Girl[3];//this is not the index value, but the amount of items it will hold. array.SetValue(ana, 0); array.SetValue(kelsey, 1); array.SetValue(meghan, 2); for (int i = 0; i < array.Length; i++) { Girl loopGirl = (Girl)array.GetValue(i); if (loopGirl.Hot == true) { Console.WriteLine("{0} is a sexy lady.\n", loopGirl.Name); } else { Console.WriteLine("{0} is not attractive.\n", loopGirl.Name); } } }
public bool InsertGirl(Girl girl) { try { bool res = false; con.Open(); NpgsqlCommand command = new NpgsqlCommand($"INSERT INTO girls (fullname, age, hair, eyes) values(@fullname, @age, @hair, @eyes)", con); command.Parameters.AddWithValue("@fullname", girl.Fullname); command.Parameters.AddWithValue("@age", girl.Age); command.Parameters.AddWithValue("@hair", girl.Hair); command.Parameters.AddWithValue("@eyes", girl.Eyes); if (command.ExecuteNonQuery() != 0) { res = true; } con.Close(); return(res); } catch { con.Close(); return(false); } }
public override void Attack() { Girl girl = EnemyHandler.GetInstance().GetGirl(); if (girl == null) { return; } if (girl.IsTaken()) { return; } Stop(); SetState(State.ATTACKING); target = girl.transform; Vector3 targetPos = target.position - ray.transform.position; SetRayAngle(targetPos); girl.SetCaptor(this); takingGirl = true; girlStartPos = target.position; girlMovementTimer = 0f; girlMovementDuration = Vector3.Distance(ray.transform.position, girlStartPos) / girlMovementSpeed; }
// Start is called before the first frame update void Start() { text = GetComponentInChildren <Text>(); player = GameObject.FindWithTag("Player").GetComponent <Player>(); girl = GameObject.FindWithTag("Girl").GetComponent <Girl>(); enemy = GameObject.FindWithTag("Enemy1").GetComponent <Enemy1>(); }
private Girl GetGirlValues(Girl girl) { Girl res = new Girl(); if (girl != null) { Console.WriteLine("Current Girl"); Console.WriteLine(girl); res.Id = girl.Id; } Console.WriteLine("Enter name:"); res.Fullname = Console.ReadLine(); Console.WriteLine("Enter age:"); res.Age = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter hair color:"); res.Hair = Console.ReadLine(); Console.WriteLine("Enter eye color:"); res.Eyes = Console.ReadLine(); return(res); }
protected virtual void OnAttackApproach() { Girl girl = EnemyHandler.GetInstance().GetGirl(); bool exit = true; if (state == State.ATTACKING) { if (girl != null) { if (!girl.IsTaken()) { girl.SetCaptor(this); exit = false; Vector3 exitPos = GetNearExitPath(); exitPos = NormalizeVector(exitPos); StartMoving(exitPos); SetState(State.KIDNAPPING); SetFinishedListener(OnEscaped); } } } if (exit) { OnStartExit(); } }
public void ActFunction(PoopStoryAct e) { _girlAnimator.SetBool("isAtDoor", false); _girlAnimator.SetBool("isShadowTalk", false); switch (e.GirlState) { case Girl.atBlank: // Debug.Log ("Girl At Blank"); _girlAnimator.SetBool("isAtDoor", false); _girlAnimator.SetBool("isShadowTalk", false); break; case Girl.atDoor: _girlAnimator.SetBool("isShadowTalk", false); _girlAnimator.SetBool("isAtDoor", true); // Debug.Log ("Girl is at door"); //condition to allow door //snap girl into position break; case Girl.atShadow: // Debug.Log ("Girl is at Shadow"); _girlAnimator.SetBool("isAtDoor", false); _girlAnimator.SetBool("isShadowTalk", true); break; } _priorState = e.GirlState; }
void SaveGirls() { if (!Directory.Exists("waifus")) { Directory.CreateDirectory("waifus"); } int saved = 0; foreach (var pair in allGirls) { Girl girl = pair.Value; byte[] pngData = girl.small.EncodeToPNG(); string filename = girl.compressedID; if (filename.StartsWith(GZIP_HEADER)) { filename = filename.Substring(GZIP_HEADER.Length); } string filepath = $"waifus/{filename}.png"; // string filename = $"waifus/{girl.id}.png"; if (!File.Exists(filepath)) { File.WriteAllBytes(filepath, pngData); saved++; } } Debug.Log($"Checked {allGirls.Count}, Saved {saved} waifus"); }
// WWWクラスを使って Emotion API を呼び出す関数 IEnumerator WaitForRes(byte[] bytes) { // Emotion REST API string url = "https://api.projectoxford.ai/emotion/v1.0/recognize"; // リクエストヘッダー Dictionary <string, string> header = new Dictionary <string, string>(); header.Add("Content-Type", "application/octet-stream"); header.Add("Ocp-Apim-Subscription-Key", SUBSCRIPTION_KEY); // bytesはカメラ画像 WWW www = new WWW(url, bytes, header); // 非同期なのでレスポンスを待つ yield return(www); Debug.Log(www.error); // エラーじゃなければ解析結果のJSONを取得 if (www.error == null) { // Debug.Log(www.text); var emotionJsonArray = JArray.Parse(www.text); JObject scores = (JObject)emotionJsonArray[0]["scores"]; string emotion = getEmotion(scores); Girl g = girl.GetComponent <Girl>(); g.SetFace(emotion); } }
public void get_first_girl_when_girls_is_empty() { var girls = new Girl[] { }; TestDelegate action = () => JoeyFirst(girls); Assert.Throws <InvalidOperationException>(action); }
public void TestCute(Girl cuteGirl) { Cute cute = new Cute(cuteGirl); _output.WriteLine("Running cute test for girl: " + cuteGirl); Assert.True(cute.IsCute(), "Girl is not cute, Reason: " + cute.Reason + "\n" + cuteGirl); //Assert.True(cute.IsCute(), "Girl is not cute, Reason: " + cute.Reason); }
public ActionResult DeleteConfirmed(int id) { Girl girl = db.girls.Find(id); db.girls.Remove(girl); db.SaveChanges(); return(RedirectToAction("Index")); }
// Start is called before the first frame update void Start() { player = GameObject.FindWithTag("Player").GetComponent <Player>(); girl = GameObject.FindWithTag("Girl").GetComponent <Girl>(); mt = GameObject.FindWithTag("MessageText").GetComponent <MessageText>(); Maxhp = hp; }
void OnTriggerEnter2D(Collider2D them) { var girl = them.GetComponent <Girl>(); if (girl) { possibleInteraction = girl; } }
void OnTriggerExit2D(Collider2D collider) { Girl girl = collider.GetComponent <Girl> (); if (girl != null) { isGirlInCave = false; } }
public PoopStoryAct(Girl girlState, Door doorState, Chain chainState, PoopMonster poopMonsterState, Shadow shadowState, LightsPoop lightsPoopState) { GirlState = girlState; DoorState = doorState; ChainState = chainState; PoopMonsterState = poopMonsterState; ShadowState = shadowState; LightsPoopState = lightsPoopState; }
public static void PozivPoDelegatu(Sortiranje Met) { Girl Ivana = new Girl(125, new DateTime(2000, 6, 24)); Girl Jelena = new Girl(110, new DateTime(2002, 11, 21)); int Ret = Met(Ivana, Jelena); Console.WriteLine(Ret < 0 ? "Ivana < Jelena" : Ret == 0 ? "Ivana == Jelena" : "Ivana > Jelena"); }
void OnTriggerEnter2D(Collider2D collider) { Girl girl = collider.GetComponent <Girl> (); if (girl != null) { isGirlInCave = true; StartCoroutine(openCave()); } }
public ActionResult Edit([Bind(Include = "ID,Name,Gender,Major,EntranceDate")] Girl girl) { if (ModelState.IsValid) { db.Entry(girl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(girl)); }
void SetGirls() { content = string.Empty; foreach (KeyValuePair <string, Girl> kv in girls) { Girl gl = kv.Value; content += gl.ToString(isEng); content += "\n\n"; } }
// Start is called before the first frame update void Start() { player = GameObject.FindWithTag("Player").GetComponent <Player>(); girl = GameObject.FindWithTag("Girl").GetComponent <Girl>(); enemy = GameObject.FindWithTag("Enemy1").GetComponent <Enemy1>(); fade = GameObject.FindWithTag("Fade").GetComponent <Fade>(); scene = GetComponent <Scene>(); fade.isFadeOut = true; }
public void girl_is_empty_should_throw_exception() { var girls = new Girl[] { }; TestDelegate action = () => girls.JoeyFirst(current => current.Age > 25); Assert.Throws <InvalidOperationException>(action); }
private static void Main() { var field = Console.ReadLine().Split().Select(BigInteger.Parse).ToArray(); var molly = new Girl(0, "Molly"); var dolly = new Girl(field.Length - 1, "Dolly"); const bool gameHasEnded = false; while (!gameHasEnded) { if (molly.Position == dolly.Position) { var flowers = field[molly.Position]; molly.Flowers += flowers / 2; dolly.Flowers += flowers / 2; field[molly.Position] = flowers % 2; } } }
static void Main() { var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); int N = input.Length; BigInteger[] F = new BigInteger[N + 1]; for (int i = 1; i <= N; i++) { F[i] = BigInteger.Parse(input[i-1]); } Girl Molly = new Girl(); Molly.x = 1; Molly.totalFlowers = 0; Molly.direction = 1; Molly.stopped = false; Girl Dolly = new Girl(); Dolly.x = N; Dolly.totalFlowers = 0; Molly.stopped = false; Dolly.direction = -1; while (!Molly.stopped && !Dolly.stopped) { BigInteger moveMolly = F[(int)Molly.x]; BigInteger moveDolly = F[(int)Dolly.x]; if (F[(int)Molly.x] == 0) { Molly.stopped = true; } if (F[(int)Dolly.x] == 0) { Dolly.stopped = true; } if (Molly.x == Dolly.x) { Molly.totalFlowers += F[(int)Molly.x] / 2; Dolly.totalFlowers += F[(int)Dolly.x] / 2; F[(int)Molly.x] = 1; } else { Molly.totalFlowers += F[(int)Molly.x]; Dolly.totalFlowers += F[(int)Dolly.x]; F[(int)Molly.x] = 0; F[(int)Dolly.x] = 0; } if (Molly.stopped || Dolly.stopped) { break; } Molly.x += (Molly.direction * moveMolly); Dolly.x += Dolly.direction * moveDolly; if (Molly.x > N) { Molly.x = Molly.x % N; } if (Dolly.x < 1) { Dolly.x = (Dolly.x % N) + N; } } if (Molly.stopped && !Dolly.stopped) { Console.WriteLine("Dolly"); } else if (Dolly.stopped && !Molly.stopped) { Console.WriteLine("Molly"); } else { Console.WriteLine("Draw"); } Console.WriteLine("{0} {1}", Molly.totalFlowers, Dolly.totalFlowers); }
void swapMainGirl(Girl girl) { girlsAnimator.SetTrigger("ChangeGirl"); girlsAnimator.SetInteger("MainGirl", (int) girl); girlsTheme[(int) girl - 1].Play(); Debug.Log(girl+" formation!"); }