private FriendshipLink CreateFriendship(Person p1, Person p2) { FriendshipLink f = new FriendshipLink(p1, p2, Random.value); Friendship f1 = new Friendship(p1, p2, f); Friendship f2 = new Friendship(p2, p1, f); f1.Other = f2; f2.Other = f1; p1.AddFriendship(f1); p2.AddFriendship(f2); return f; }
private int killCount = 0; //Number of people dead in this relationship #endregion Fields #region Constructors public FriendshipLink(Person p1, Person p2, float importance) { friend1 = p1; friend2 = p2; this.importance = importance; }
private Person CreatePerson(int id, float x, float y, float z) { Vector3 pos = new Vector3(x, y, z); //Value between 3 and 21 float connectionDuration = Utils.GetRandomValue(12, 9, 3); int connectionTime = Random.Range(0, 24 * 60); int disconnectionTime = (connectionTime + (int)(connectionDuration * 60)) % (24 * 60); float freq = Utils.GetRandomValue(0, 1, 3); bool isFemale = Random.value <= 0.5; /* string fName = "Fifi"; //isFemale ? NameGenerator.GetFemaleName() : NameGenerator.GetMaleName(); string lName = "Brindacier"; //NameGenerator.GetLastName();*/ var generatedPerson = isFemale ? PersonGenerator.GetGeneratedFemale() : PersonGenerator.GetGeneratedMale(); Person p = new Person(id, generatedPerson.FirstName, generatedPerson.LastName, pos, connectionTime, disconnectionTime, freq, generatedPerson.Picture); return p; }
public DistanceNode(Person p1, Person p2) { p = p2; dist = (p2.InitialPosition - p1.InitialPosition).sqrMagnitude; }
public void RegisterKill(Person p) { numDead++; numAlive--; Awareness = (Awareness * (NumAlive + 1) - p.AwarenessLevel) / NumAlive; Debug.Log("Killed - " + p.AwarenessLevel + " nK = " + numAlive); }