本文整理汇总了C#中CodeEnv.Master.GameContent.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于CodeEnv.Master.GameContent命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasAccessToInfo
private bool HasAccessToInfo(IntelCoverage coverage, ItemInfoID infoID, Player player) {
switch (coverage) {
case IntelCoverage.Comprehensive:
if (HasAccessToInfo_Comprehensive(infoID, player)) {
return true;
}
goto case IntelCoverage.Broad;
case IntelCoverage.Broad:
if (HasAccessToInfo_Broad(infoID, player)) {
return true;
}
goto case IntelCoverage.Essential;
case IntelCoverage.Essential:
if (HasAccessToInfo_Essential(infoID, player)) {
return true;
}
goto case IntelCoverage.Basic;
case IntelCoverage.Basic:
if (HasAccessToInfo_Basic(infoID, player)) {
return true;
}
goto case IntelCoverage.None;
case IntelCoverage.None:
return false;
default:
throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(coverage));
}
}
示例2: HasAccessToInfo_Basic
protected override bool HasAccessToInfo_Basic(ItemInfoID infoID, Player player) {
switch (infoID) {
case ItemInfoID.Name:
case ItemInfoID.Position:
case ItemInfoID.SectorID:
return true;
case ItemInfoID.Owner:
// If gets here, System IntelCoverage is Basic, but a member could be allowing access
SystemData sysData = _data as SystemData;
bool starHasAccess = sysData.StarData.InfoAccessCntlr.HasAccessToInfo(player, infoID);
if (starHasAccess) {
return true;
}
else {
bool anyPlanetoidHasAccess = sysData.AllPlanetoidData.Select(pData => pData.InfoAccessCntlr).Any(iac => iac.HasAccessToInfo(player, infoID));
if (anyPlanetoidHasAccess) {
return true;
}
// WARNING: Do not inquire about Settlement Owner as Settlement inquires about System Owner creating a circular loop
}
return false;
default:
return false;
}
}
示例3: GetText
public string GetText(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
if (!IsTextCurrent(displayTgtID, player, starReport, planetoidReports, includeUnknown)) {
D.Log("{0} generating new text for Label {1}, Player {2}.", GetType().Name, displayTgtID.GetValueName(), player.LeaderName);
GenerateText(displayTgtID, player, starReport, planetoidReports, includeUnknown);
}
return _stringBuilder.ToString();
}
示例4: GetText
public string GetText(DisplayTargetID displayTgtID, Player player, AIntel intel, ShipReport[] elementReports, bool includeUnknown) {
if (!IsTextCurrent(displayTgtID, player, intel.CurrentCoverage, elementReports, includeUnknown)) {
D.Log("{0} generating new text for Label {1}, Player {2}.", GetType().Name, displayTgtID.GetValueName(), player.LeaderName);
GenerateText(displayTgtID, player, intel, elementReports, includeUnknown);
}
return _stringBuilder.ToString();
}
示例5: HasAccessToInfo_Comprehensive
protected override bool HasAccessToInfo_Comprehensive(ItemInfoID infoID, Player player) {
switch (infoID) {
case ItemInfoID.Resources:
default:
return false;
}
}
示例6: InitializeIntelState
private AIntel InitializeIntelState(Player player) {
bool isCoverageComprehensive = References.DebugControls.IsAllIntelCoverageComprehensive || Owner == player;
// 8.1.16 OPTIMIZE alliance test may not be needed. Currently, new items created in runtime test for this in their creators
isCoverageComprehensive = isCoverageComprehensive || Owner.IsRelationshipWith(player, DiplomaticRelationship.Alliance);
var coverage = isCoverageComprehensive ? IntelCoverage.Comprehensive : DefaultStartingIntelCoverage;
return MakeIntel(coverage);
}
示例7: HasAccessToInfo_Essential
protected override bool HasAccessToInfo_Essential(ItemInfoID infoID, Player player) {
switch (infoID) {
case ItemInfoID.Owner:
return true;
default:
return false;
}
}
示例8: HasAccessToInfo_Broad
protected override bool HasAccessToInfo_Broad(ItemInfoID infoID, Player player) {
switch (infoID) {
case ItemInfoID.Capacity:
return true;
default:
return false;
}
}
示例9: ShipDesign
public ShipDesign(Player player, string designName, ShipHullStat hullStat, EnginesStat enginesStat, ShipCombatStance combatStance,
IEnumerable<WeaponDesign> weaponDesigns, IEnumerable<PassiveCountermeasureStat> passiveCmStats,
IEnumerable<ActiveCountermeasureStat> activeCmStats, IEnumerable<SensorStat> sensorStats, IEnumerable<ShieldGeneratorStat> shieldGenStats, Priority hqPriority)
: base(player, designName, weaponDesigns, passiveCmStats, activeCmStats, sensorStats, shieldGenStats, hqPriority) {
HullStat = hullStat;
EnginesStat = enginesStat;
CombatStance = combatStance;
}
示例10: UnitCreatorConfiguration
public UnitCreatorConfiguration(string unitName, Player owner, GameDate deployDate, string cmdDesignName, IEnumerable<string> elementDesignNames) {
UnitName = unitName;
Owner = owner;
DeployDate = deployDate;
CmdDesignName = cmdDesignName;
ElementDesignNames = elementDesignNames;
ValidateDeployDate();
}
示例11: HandleDetectionBy
public void HandleDetectionBy(Player detectingPlayer, IUnitCmd_Ltd cmdItem, RangeCategory sensorRange) {
if (!_item.IsOperational) {
D.Error("{0} should not be detected by {1} when dead!", _item.DebugName, cmdItem.DebugName);
}
//D.Log(ShowDebugLog, "{0}.HandleDetectionBy called. Detecting Cmd: {1}, SensorRange: {2}.", DebugName, cmdItem.DebugName, sensorRange.GetValueName());
IDictionary<RangeCategory, IList<IUnitCmd_Ltd>> rangeLookup;
if (!_detectionLookup.TryGetValue(detectingPlayer, out rangeLookup)) {
Profiler.BeginSample("Proper Dictionary allocation", (_item as Component).gameObject);
rangeLookup = new Dictionary<RangeCategory, IList<IUnitCmd_Ltd>>(3, RangeCategoryEqualityComparer.Default); // OPTIMIZE check size
Profiler.EndSample();
_detectionLookup.Add(detectingPlayer, rangeLookup);
}
IList<IUnitCmd_Ltd> cmds;
if (!rangeLookup.TryGetValue(sensorRange, out cmds)) {
Profiler.BeginSample("Proper List allocation", (_item as Component).gameObject);
cmds = new List<IUnitCmd_Ltd>();
Profiler.EndSample();
rangeLookup.Add(sensorRange, cmds);
}
D.Assert(!cmds.Contains(cmdItem), cmdItem.DebugName);
cmds.Add(cmdItem);
// The following returns can not move earlier in method as detection state must be kept current to support Reset
if (_debugControls.IsAllIntelCoverageComprehensive) {
// Should already be set to comprehensive during game startup
__ValidatePlayerIntelCoverageOfItemIsComprehensive(detectingPlayer);
// Note: this debug setting DOES NOT pre-populate all player's knowledge
if (_item.Owner.IsRelationshipWith(detectingPlayer, DiplomaticRelationship.Alliance, DiplomaticRelationship.Self)) {
// even with DebugSettings all coverage comprehensive, still no reason to update if Alliance or Self
__ValidatePlayerIntelCoverageOfItemIsComprehensive(detectingPlayer); // UNCLEAR why called again?
__ValidatePlayerKnowledgeOfItem(detectingPlayer);
return;
}
UpdatePlayerKnowledge(detectingPlayer);
return; // continuing could regress coverage on items that allow it
}
if (_item.Owner.IsRelationshipWith(detectingPlayer, DiplomaticRelationship.Alliance, DiplomaticRelationship.Self)) {
// Should already be set to comprehensive when became self or alliance took place
__ValidatePlayerIntelCoverageOfItemIsComprehensive(detectingPlayer);
__ValidatePlayerKnowledgeOfItem(detectingPlayer);
return; // continuing could regress coverage on items that allow it
}
Profiler.BeginSample("AssignDetectingPlayerIntelCoverage", (_item as Component).gameObject);
AssignDetectingPlayerIntelCoverage(detectingPlayer);
Profiler.EndSample();
Profiler.BeginSample("UpdatePlayerKnowledge", (_item as Component).gameObject);
UpdatePlayerKnowledge(detectingPlayer);
Profiler.EndSample();
}
示例12: HasAccessToInfo_Basic
protected override bool HasAccessToInfo_Basic(ItemInfoID infoID, Player player) {
switch (infoID) {
case ItemInfoID.Name:
case ItemInfoID.Position:
return true;
default:
return false;
}
}
示例13: FacilityData
/// <summary>
/// Initializes a new instance of the <see cref="FacilityData" /> class.
/// </summary>
/// <param name="facility">The facility.</param>
/// <param name="owner">The owner.</param>
/// <param name="passiveCMs">The passive countermeasures.</param>
/// <param name="hullEquipment">The hull equipment.</param>
/// <param name="activeCMs">The active countermeasures.</param>
/// <param name="sensors">The sensors.</param>
/// <param name="shieldGenerators">The shield generators.</param>
/// <param name="hqPriority">The HQ priority.</param>
/// <param name="topography">The topography.</param>
public FacilityData(IFacility facility, Player owner, IEnumerable<PassiveCountermeasure> passiveCMs, FacilityHullEquipment hullEquipment,
IEnumerable<ActiveCountermeasure> activeCMs, IEnumerable<Sensor> sensors, IEnumerable<ShieldGenerator> shieldGenerators,
Priority hqPriority, Topography topography)
: base(facility, owner, passiveCMs, hullEquipment, activeCMs, sensors, shieldGenerators, hqPriority) {
Topography = topography;
Science = hullEquipment.Science;
Culture = hullEquipment.Culture;
Income = hullEquipment.Income;
}
示例14: GetReport
public FleetReport GetReport(Player player, AIntel intel, ShipReport[] elementReports) {
if (!IsReportCurrent(player, intel.CurrentCoverage, elementReports)) {
D.Log("{0} generating new {1} for Player {2}.", GetType().Name, typeof(FleetReport).Name, player.LeaderName);
_elementReports = elementReports;
_report = GenerateReport(player, intel, elementReports);
_data.AcceptChanges();
}
return _report;
}
示例15: GetReport
public SystemReport GetReport(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) {
if (!IsReportCurrent(player, starReport, planetoidReports)) {
D.Log("{0} generating new {1} for Player {2}.", GetType().Name, typeof(SystemReport).Name, player.LeaderName);
_starReport = starReport;
_planetoidReports = planetoidReports;
_report = GenerateReport(player, starReport, planetoidReports);
_data.AcceptChanges();
}
return _report;
}