Example #1
0
        public Location(Vector2 mapPosition)
        {
            this.type = LocationType.Random();

            this.name = RandomName(type);

            this.mapPosition = mapPosition;

            if (type.HasHireableCharacters)
            {
                hireManager = new HireManager();
                hireManager.GenerateCharacters(this, HireManager.MaxAvailableCharacters);
            }

            Connections = new List <LocationConnection>();
        }
Example #2
0
        public IEnumerable <CharacterInfo> GetHireableCharacters()
        {
            if (!Type.HasHireableCharacters)
            {
                return(Enumerable.Empty <CharacterInfo>());
            }

            if (hireManager == null)
            {
                hireManager = new HireManager();
            }
            if (!hireManager.AvailableCharacters.Any())
            {
                hireManager.GenerateCharacters(location: this, amount: HireManager.MaxAvailableCharacters);
            }
            return(hireManager.AvailableCharacters);
        }