public Customer(string name = null, int sex = 0) { Id = Count++; // Generate random first/last name and assign it to customer if (name == null) { if (sex == 1) { Name = RandomNameGenerator.Generate(Gender.Male); } else { Name = RandomNameGenerator.Generate(Gender.Female); } } else { Name = name; } if (sex == 0) { var random = new Random(); Sex = random.Next(1, 3); } else { Sex = sex; } }
/// <summary> /// To be called if current game session ends /// </summary> public void endSession() { if (enabled && sessionRunning) { Event endEvent = new Event(Event.TYPE.sessionEnd); endEvent.addPlayerCount().addWave().addLevel(); if (!eventBuild && currentSession.steamName != null && !currentSession.steamName.Equals("")) { endEvent.addGameName(currentSession.steamName); } else { endEvent.addGameName(RandomNameGenerator.Generate()); } Debug.Log(RandomNameGenerator.Generate()); endEvent.addPlayerCharacters(); endEvent.addMode(currentSession.mode); addEvent(endEvent); } sessionRunning = false; // is the hound burried here? eventQueue.Clear(); }
public void create_female_customer() { Console.WriteLine("create_female_customer"); var fullname = RandomNameGenerator.Generate(Gender.Female); ICustomer customer = new Customer(fullname, 2); Assert.AreEqual(customer.Sex, 2); }
public static CharacterSheet CreateBlueMage() { return(new CharacterSheet() { Name = RandomNameGenerator.Generate(), Class = CharacterClass.BlueWizard, Powers = new List <PowerName> { PowerName.CastWater } }); }
public static CharacterSheet CreateWarrior() { return(new CharacterSheet() { Name = RandomNameGenerator.Generate(), Class = CharacterClass.Warrior, Powers = new List <PowerName> { PowerName.StrongBody } }); }
// Create a new customer public static ICustomer CreateNew() { String customerName = ""; var sex = _randomGender.Next(1, 3); if (sex == 1) { customerName = RandomNameGenerator.Generate(Gender.Male); } else { customerName = RandomNameGenerator.Generate(Gender.Female); } return(new Customer(customerName, sex)); }
public void AddIllustration(Illustration illus, TSession session, List <CharacterSheet> remainingPaladins) { switch (illus) { case Illustration.Grass: int r = R.Next(3); switch (r) { case 0: illus = Illustration.Grass2; break; case 1: illus = Illustration.Grass3; break; } break; case Illustration.Chest: case Illustration.Chest2: case Illustration.Cobweb: case Illustration.Grave: case Illustration.Grave2: case Illustration.WoodenGrave: case Illustration.Rock: case Illustration.AutumnTree: case Illustration.Bush: case Illustration.Bag: BlocksMovement = true; break; case Illustration.BrownBrick: case Illustration.BrownDoor: BlocksLineOfSight = true; BlocksMovement = true; break; case Illustration.BlueCivilian: case Illustration.GreenCivilian: case Illustration.PurpleCivilian: session.Characters.Add(new Character("Civilian " + RandomNameGenerator.Generate(), true, illus, new Vector2(this.X, this.Y), session)); illus = Illustration.None; break; case Illustration.Ghoul: session.Characters.Add(new Character("Undead Ghoul", true, illus, new Vector2(this.X, this.Y), session) { Hostile = true, NPCDescription = "Undead abomination", HP = 5, MaxHP = 5 }); illus = Illustration.None; break; case Illustration.WarriorPaladin: illus = Illustration.None; SpawnPaladinHereIfAble(remainingPaladins, session); break; case Illustration.Evac: session.EvacuationTile = this; break; case Illustration.Fire32: illus = Illustration.None; this.Heat.StartHeavyFire(); break; } if (illus != Illustration.None) { this.Illustrations.Add(illus); ResetFuel(); } }