コード例 #1
0
ファイル: Location.cs プロジェクト: d34d10cc/Barotrauma
        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>();
        }
コード例 #2
0
ファイル: Location.cs プロジェクト: yweber/Barotrauma
        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);
        }