Esempio n. 1
0
    IEnumerator SpawnNPC()
    {
        yield return(new WaitForSeconds(Random.Range(minSecondsBetweenSpawn, maxSecondsBetweenSpawn)));

        var npc = Instantiate(NPC);

        npc.GetComponent <NPC>().PlayerName = RandomName.Generate();

        StartCoroutine(SpawnNPC());
    }
Esempio n. 2
0
        public static Person GetRandom()
        {
            Person peep = new Person();

            peep.Age          = Global.RandomGenerator.Next(100);
            peep.Name         = m_nameGen.Generate(Sex.Male);
            peep.State        = Global.RandomState();
            peep.FriendsNames = m_nameGen.RandomNames(100, 2);

            return(peep);
        }
Esempio n. 3
0
    public Ghost GenerateGhost(Board board)
    {
        Ghost ghost = Object.Instantiate(PrefabRegistry.I.ghost).GetComponent <Ghost>();

        ghost.Init(0);
        ghost.nameSet = RandomName.Generate();

        ghost.summonRoom     = RandomRoom(board);
        ghost.summonPosition = FindSummonPosition(ghost.summonRoom);

        InstallRandomPersonality(ghost);

        return(ghost);
    }
Esempio n. 4
0
        public static Worker GenerateRandomWorker()
        {
            Random     rand    = new Random();
            RandomName nameGen = new RandomName(rand);
            var        worker  = new Worker()
            {
                Name = nameGen.Generate((Sex)rand.Next(0, 2), rand.Next(0, 2)), Cost = 2000
            };
            var weights = new Dictionary <int, int>()
            {
                { 1, 40 },
                { 2, 40 },
                { 3, 15 },
                { 4, 4 },
                { 5, 1 },
            };

            worker.Efficiency = WeightedRandomizer.From(weights).TakeOne();
            return(worker);
        }
Esempio n. 5
0
        public PlayerState()
        {
            this.MoneyPercentageSkillLevel      = 1;
            this.EfficiencyPercentageSkillLevel = 1;
            Random     rand    = new Random();
            RandomName nameGen = new RandomName(rand);

            Workers = new List <Worker.Worker>
            {
                new Worker.Worker()
                {
                    Efficiency = 2, Name = nameGen.Generate((Sex)rand.Next(0, 2), rand.Next(0, 2)), Cost = 2000
                },
            };

            Customers = new List <Customer>();

            UnlockedDrinks = new List <Drink>
            {
                new Drink()
                {
                    name = "Cappuccino", price = 7
                },
                new Drink()
                {
                    name = "coffee", price = 3
                },
                new Drink()
                {
                    name = "flat white", price = 2
                }
            };

            for (var i = 0; i < 100; i++)
            {
                Customers.Add(new Customer()
                {
                    FavoriteDrink = UnlockedDrinks[0], Name = $"Customer{i}", Satisfaction = 20
                });
            }
        }
Esempio n. 6
0
 public Customer()
 {
     name     = RandomName.Generate(2);
     patience = Random.Range(30, 60);
     order    = new Order();
 }