(965c31410) v0.10.4.0
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class Location
|
||||
{
|
||||
private HireManager hireManager;
|
||||
|
||||
public void RemoveHireableCharacter(CharacterInfo character)
|
||||
{
|
||||
if (!Type.HasHireableCharacters)
|
||||
{
|
||||
DebugConsole.ThrowError("Cannot hire a character from location \"" + Name + "\" - the location has no hireable characters.\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
if (hireManager == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Cannot hire a character from location \"" + Name + "\" - hire manager has not been instantiated.\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
|
||||
hireManager.RemoveCharacter(character);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
partial void RemoveProjSpecific()
|
||||
{
|
||||
hireManager?.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user