• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# GameContent.Player类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CodeEnv.Master.GameContent.Player的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Player类属于CodeEnv.Master.GameContent命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:28,代码来源:AIntelInfoAccessController.cs


示例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;
            }
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:26,代码来源:SystemInfoAccessController.cs


示例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();
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:SystemReportGenerator.cs


示例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();
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:FleetReportGenerator.cs


示例5: HasAccessToInfo_Comprehensive

 protected override bool HasAccessToInfo_Comprehensive(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.Resources:
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:StarInfoAccessController.cs


示例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);
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:AIntelItemData.cs


示例7: HasAccessToInfo_Essential

 protected override bool HasAccessToInfo_Essential(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.Owner:
             return true;
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:8,代码来源:SectorInfoAccessController.cs


示例8: HasAccessToInfo_Broad

 protected override bool HasAccessToInfo_Broad(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.Capacity:
             return true;
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:8,代码来源:StarInfoAccessController.cs


示例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;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:8,代码来源:ShipDesign.cs


示例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();
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:8,代码来源:UnitCreatorConfiguration.cs


示例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();
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:57,代码来源:DetectionHandler.cs


示例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;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:9,代码来源:UniverseCenterInfoAccessController.cs


示例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;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:21,代码来源:FacilityData.cs


示例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;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:9,代码来源:FleetReportGenerator.cs


示例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;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:10,代码来源:SystemReportGenerator.cs


示例16: HasAccessToInfo_Comprehensive

 protected override bool HasAccessToInfo_Comprehensive(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.CurrentHitPoints:
         case ItemInfoID.Health:
         case ItemInfoID.Resources:
             return true;
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:10,代码来源:PlanetoidInfoAccessController.cs


示例17: StarData

 /// <summary>
 /// Initializes a new instance of the <see cref="StarData" /> class.
 /// </summary>
 /// <param name="star">The star.</param>
 /// <param name="starStat">The stat.</param>
 /// <param name="owner">The owner.</param>
 public StarData(IStar star, StarStat starStat, Player owner)
     : base(star, owner) {
     Category = starStat.Category;
     Radius = starStat.Radius;
     CloseOrbitInnerRadius = starStat.CloseOrbitInnerRadius;
     Capacity = starStat.Capacity;
     Resources = starStat.Resources;
     Topography = Topography.System;
     SectorID = References.SectorGrid.GetSectorIdThatContains(Position);
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:16,代码来源:StarData.cs


示例18: PlayersKnowledge

 public PlayersKnowledge(IEnumerable<Player> allPlayers) {
     int playerCount = allPlayers.Count();
     _playersKnowledgeLookup = new Dictionary<Player, PlayerKnowledge>(playerCount);
     allPlayers.ForAll(p => {
         _playersKnowledgeLookup.Add(p, new PlayerKnowledge(p));
         if (p.IsUser) {
             _userPlayer = p;
         }
     });
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:10,代码来源:PlayersKnowledge.cs


示例19: HasAccessToInfo_Comprehensive

 protected override bool HasAccessToInfo_Comprehensive(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.Culture:
         case ItemInfoID.Science:
         case ItemInfoID.NetIncome:
             return true;
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:10,代码来源:FacilityInfoAccessController.cs


示例20: HasAccessToInfo_Broad

 protected override bool HasAccessToInfo_Broad(ItemInfoID infoID, Player player) {
     switch (infoID) {
         case ItemInfoID.CurrentHitPoints:
         case ItemInfoID.Health:
         case ItemInfoID.Defense:
         case ItemInfoID.Offense:
             return true;
         default:
             return false;
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:11,代码来源:FacilityInfoAccessController.cs



注:本文中的CodeEnv.Master.GameContent.Player类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CodeGeneration.CGenState类代码示例发布时间:2022-05-24
下一篇:
C# TestDataBuilders.MemberSourceCodeBuilder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap