Exemple #1
0
        protected override void AssignValues(AItemData data) {
            var sData = data as SystemData;
            var accessCntlr = sData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = sData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = sData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = sData.SectorID;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {    // true if any member has access
                Owner = sData.Owner;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Capacity)) {    // true if all members have access
                Capacity = sData.Capacity;
            }
            else {
                Capacity = CalcPartialCapacity(sData.StarData, sData.AllPlanetoidData, sData.SettlementData);
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Resources)) {   // true if all members have access
                Resources = sData.Resources;
            }
            else {
                Resources = CalcPartialResources(sData.StarData, sData.AllPlanetoidData, sData.SettlementData);
            }
        }
Exemple #2
0
        protected override void AssignValues(AItemData data) {
            var sData = data as StarData;
            var accessCntlr = sData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = sData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = sData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = sData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = sData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = sData.Category;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Capacity)) {
                Capacity = sData.Capacity;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Resources)) {
                Resources = sData.Resources;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = sData.SectorID;
            }
        }
        protected override void AssignValues(AItemData data) {
            var ucData = data as UniverseCenterData;
            var accessCntlr = ucData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = ucData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = ucData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = ucData.Owner;
            }
        }
        protected override void AssignValues(AItemData data) {
            var pData = data as PlanetoidData;
            var accessCntlr = pData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.OrbitalSpeed)) {
                OrbitalSpeed = pData.OrbitalSpeed;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Defense)) {
                DefensiveStrength = pData.DefensiveStrength;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Capacity)) {
                Capacity = pData.Capacity;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Health)) {
                Health = pData.Health;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentHitPoints)) {
                CurrentHitPoints = pData.CurrentHitPoints;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Resources)) {
                Resources = pData.Resources;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = pData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = pData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = pData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = pData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = pData.Category;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.MaxHitPoints)) {
                MaxHitPoints = pData.MaxHitPoints;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Mass)) {
                Mass = pData.Mass;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = pData.SectorID;
            }
        }
Exemple #5
0
        protected override void AssignValues(AItemData data) {
            var sData = data as SectorData;
            var accessCntlr = sData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = sData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = sData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = sData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = sData.SectorID;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Capacity)) {    // true if all members have access
                Capacity = sData.Capacity;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Resources)) {   // true if all members have access
                Resources = sData.Resources;
            }
        }
Exemple #6
0
        protected override void AssignValues(AItemData data) {
            var sData = data as ShipData;
            var accessCntlr = sData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Culture)) {
                Culture = sData.Culture;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Defense)) {
                DefensiveStrength = sData.DefensiveStrength;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Offense)) {
                OffensiveStrength = sData.OffensiveStrength;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Health)) {
                Health = sData.Health;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.AlertStatus)) {
                AlertStatus = sData.AlertStatus;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentHitPoints)) {
                CurrentHitPoints = sData.CurrentHitPoints;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Science)) {
                Science = sData.Science;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.NetIncome)) {
                Income = sData.Income;
                Expense = sData.Expense;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = sData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = sData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = sData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = sData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = sData.HullCategory;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.MaxHitPoints)) {
                MaxHitPoints = sData.MaxHitPoints;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Mass)) {
                Mass = sData.Mass;
            }
            // SensorRange on an element makes little sense
            ////if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SensorRange)) {
            ////    SensorRange = sData.SensorRange;
            ////}
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.WeaponsRange)) {
                WeaponsRange = sData.WeaponsRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = sData.SectorID;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Target)) {
                Target = sData.Target;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CombatStance)) {
                CombatStance = sData.CombatStance;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentSpeedSetting)) {
                CurrentSpeedSetting = sData.CurrentSpeedSetting;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.FullSpeed)) {
                FullSpeed = sData.FullSpeedValue;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.MaxTurnRate)) {
                MaxTurnRate = sData.MaxTurnRate;
            }

            __ActualSpeedValue = (Item as IShip_Ltd).ActualSpeedValue_Debug;
        }
Exemple #7
0
 protected abstract void AssignValues(AItemData data);
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AItemReport" /> class.
 /// </summary>
 /// <param name="player">The player requesting the report.</param>
 /// <param name="item">The item the report is about.</param>
 public AItemReport(AItemData data, Player player, IItem_Ltd item) {
     Player = player;
     Item = item;
     __PositionForCameraDistance = new Reference<Vector3>(() => item.Position);
     AssignValues(data);
 }
        protected override void AssignValues(AItemData data) {
            var sData = data as SettlementCmdData;
            var accessCntlr = sData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.AlertStatus)) {
                AlertStatus = sData.AlertStatus;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitDefense)) {
                UnitDefensiveStrength = sData.UnitDefensiveStrength;
            }
            else {
                UnitDefensiveStrength = CalcPartialUnitDefensiveStrength(GetElementsData(sData));
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitOffense)) {
                UnitOffensiveStrength = sData.UnitOffensiveStrength;
            }
            else {
                UnitOffensiveStrength = CalcPartialUnitOffensiveStrength(GetElementsData(sData));
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitMaxHitPts)) {
                UnitMaxHitPoints = sData.UnitMaxHitPoints;
            }
            else {
                UnitMaxHitPoints = CalcPartialUnitMaxHitPoints(GetElementsData(sData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitCurrentHitPts)) {
                UnitCurrentHitPoints = sData.UnitCurrentHitPoints;
            }
            else {
                UnitCurrentHitPoints = CalcPartialUnitCurrentHitPoints(GetElementsData(sData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitHealth)) {
                UnitHealth = sData.UnitHealth;
            }
            else {
                // Calculate HitPts before attempting calc of partial unit health
                UnitHealth = CalcPartialUnitHealth(UnitCurrentHitPoints, UnitMaxHitPoints);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitScience)) {
                UnitScience = sData.UnitScience;
            }
            else {
                UnitScience = CalcPartialUnitScience(GetElementsData(sData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitCulture)) {
                UnitCulture = sData.UnitCulture;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitNetIncome)) {
                UnitIncome = sData.UnitIncome;
                UnitExpense = sData.UnitExpense;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = sData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = sData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = sData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = sData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentCmdEffectiveness)) {
                CurrentCmdEffectiveness = sData.CurrentCmdEffectiveness;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitSensorRange)) {
                UnitSensorRange = sData.UnitSensorRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitWeaponsRange)) {
                UnitWeaponsRange = sData.UnitWeaponsRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = sData.SectorID;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Formation)) {
                UnitFormation = sData.UnitFormation;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Capacity)) {
                Capacity = sData.Capacity;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Resources)) {
                Resources = sData.Resources;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Composition)) { // must preceed Category
                UnitComposition = sData.UnitComposition;
            }
            else {
                UnitComposition = CalcPartialUnitComposition(sData);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = sData.Category;
            }
            else {
                Category = CalcPartialCmdCategory(sData);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Population)) {
                Population = sData.Population;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Approval)) {
                Approval = sData.Approval;
            }
        }
        protected override void AssignValues(AItemData data) {
            var fData = data as FleetCmdData;
            var accessCntlr = fData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.AlertStatus)) {
                AlertStatus = fData.AlertStatus;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitDefense)) {
                UnitDefensiveStrength = fData.UnitDefensiveStrength;
            }
            else {
                UnitDefensiveStrength = CalcPartialUnitDefensiveStrength(GetElementsData(fData));
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitOffense)) {
                UnitOffensiveStrength = fData.UnitOffensiveStrength;
            }
            else {
                UnitOffensiveStrength = CalcPartialUnitOffensiveStrength(GetElementsData(fData));
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitMaxHitPts)) {
                UnitMaxHitPoints = fData.UnitMaxHitPoints;
            }
            else {
                UnitMaxHitPoints = CalcPartialUnitMaxHitPoints(GetElementsData(fData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitCurrentHitPts)) {
                UnitCurrentHitPoints = fData.UnitCurrentHitPoints;
            }
            else {
                UnitCurrentHitPoints = CalcPartialUnitCurrentHitPoints(GetElementsData(fData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitHealth)) {
                UnitHealth = fData.UnitHealth;
            }
            else {
                // Calculate HitPts before attempting calculation of partial unit health
                UnitHealth = CalcPartialUnitHealth(UnitCurrentHitPoints, UnitMaxHitPoints);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitScience)) {
                UnitScience = fData.UnitScience;
            }
            else {
                UnitScience = CalcPartialUnitScience(GetElementsData(fData));
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitNetIncome)) {
                UnitIncome = fData.UnitIncome;
                UnitExpense = fData.UnitExpense;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitCulture)) {
                UnitCulture = fData.UnitCulture;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = fData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = fData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = fData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = fData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentCmdEffectiveness)) {
                CurrentCmdEffectiveness = fData.CurrentCmdEffectiveness;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitSensorRange)) {
                UnitSensorRange = fData.UnitSensorRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitWeaponsRange)) {
                UnitWeaponsRange = fData.UnitWeaponsRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = fData.SectorID;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Formation)) {
                UnitFormation = fData.UnitFormation;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Target)) {
                Target = fData.Target;
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Composition)) { // must precede Category
                UnitComposition = fData.UnitComposition;
            }
            else {
                UnitComposition = CalcPartialUnitComposition(fData);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = fData.Category;
            }
            else {
                Category = CalcPartialCmdCategory(fData);
            }

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentHeading)) {
                CurrentHeading = fData.CurrentHeading;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentSpeedSetting)) {
                CurrentSpeedSetting = fData.CurrentSpeedSetting;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitFullSpeed)) {
                UnitFullSpeed = fData.UnitFullSpeedValue;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.UnitMaxTurnRate)) {
                UnitMaxTurnRate = fData.UnitMaxTurnRate;
            }

            __ActualSpeedValue = (Item as IFleetCmd_Ltd).ActualSpeedValue_Debug;
        }
        protected override void AssignValues(AItemData data) {
            var fData = data as FacilityData;
            var accessCntlr = fData.InfoAccessCntlr;

            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Culture)) {
                Culture = fData.Culture;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Defense)) {
                DefensiveStrength = fData.DefensiveStrength;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Offense)) {
                OffensiveStrength = fData.OffensiveStrength;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Health)) {
                Health = fData.Health;  // Element Health only matters on Element displays
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.AlertStatus)) {
                AlertStatus = fData.AlertStatus;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.CurrentHitPoints)) {
                CurrentHitPoints = fData.CurrentHitPoints;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Science)) {
                Science = fData.Science;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.NetIncome)) {
                Income = fData.Income;
                Expense = fData.Expense;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Name)) {
                Name = fData.Name;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.ParentName)) {
                ParentName = fData.ParentName;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Position)) {
                Position = fData.Position;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Owner)) {
                Owner = fData.Owner;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Category)) {
                Category = fData.HullCategory;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.MaxHitPoints)) {
                MaxHitPoints = fData.MaxHitPoints;  // should always be with or before CurrentHitPts as both are needed to calc CmdReport's UnitHealth
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.Mass)) {
                Mass = fData.Mass;
            }
            // SensorRange on an element makes little sense
            //if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SensorRange)) {
            //    SensorRange = fData.SensorRange;
            //}
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.WeaponsRange)) {
                WeaponsRange = fData.WeaponsRange;
            }
            if (accessCntlr.HasAccessToInfo(Player, ItemInfoID.SectorID)) {
                SectorID = fData.SectorID;
            }
        }