コード例 #1
0
ファイル: Villager.cs プロジェクト: jpgdev/TownSimulator
        public Villager(string firstname, string lastname, Town hometown)
            : base()
        {
            FirstName = firstname;
            LastName  = lastname;
            Age       = (uint)new Random().Next(18, 50);

            Hunger = 0;
            Thirst = 0;

            HomeTown = hometown;
            hometown.AddVillager(this);

            _latestEvents = new Queue <EnvironmentEvent>();
            for (int i = 0; i < _INITIAL_NB_DECISIONS; i++)
            {
                _latestEvents.Enqueue(EnvironmentEvent.Manual);
            }

            _makeDecision = new SemaphoreSlim(_INITIAL_NB_DECISIONS);
        }