Example #1
0
        protected void SetId()
        {
            SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString());

            SetIdMarker();
            SetSpotlightMask();
        }
Example #2
0
        /// <summary>
        /// Returns true if Booking instances are equal
        /// </summary>
        /// <param name="other">Instance of Booking to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Booking other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ShipId == other.ShipId ||
                     ShipId != null &&
                     ShipId.Equals(other.ShipId)
                 ) &&
                 (
                     BookingDate == other.BookingDate ||
                     BookingDate != null &&
                     BookingDate.Equals(other.BookingDate)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ));
        }
Example #3
0
 public ShipPowerup(ShipId shipId, IReadOnlyCollection <ShipId> consumedShipIds, bool isSuccess, IRawShip updatedTo)
 {
     ShipId          = shipId;
     ConsumedShipIds = consumedShipIds;
     IsSuccess       = isSuccess;
     UpdatedTo       = updatedTo;
 }
Example #4
0
        private void SetShipIdText(GameObject model)
        {
            TextMesh ShipIdText = model.transform.Find("RotationHelper/RotationHelper2/ShipAllParts/ShipIdText").GetComponent <TextMesh>();

            ShipIdText.text  = ShipId.ToString();
            ShipIdText.color = (Owner.PlayerNo == Players.PlayerNo.Player1) ? Color.green: Color.red;
        }
Example #5
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (ShipId != null)
         {
             hashCode = hashCode * 59 + ShipId.GetHashCode();
         }
         if (ShipName != null)
         {
             hashCode = hashCode * 59 + ShipName.GetHashCode();
         }
         if (BookingDate != null)
         {
             hashCode = hashCode * 59 + BookingDate.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #6
0
 public ShipPowerup(ShipId shipId, IReadOnlyCollection <ShipId> consumedShipIds, bool isSuccess, RawShip updatedTo, bool dismantleEquipments)
 {
     ShipId              = shipId;
     ConsumedShipIds     = consumedShipIds;
     IsSuccess           = isSuccess;
     UpdatedTo           = updatedTo;
     DismantleEquipments = dismantleEquipments;
 }
Example #7
0
 public void AddShipService(ShipServiceId shipServiceId, ShipId shipId)
 {
     if (shipServiceId == null)
     {
         throw new ArgumentNullException(nameof(shipServiceId));
     }
     RaiseEvent(new InvoiceShipServiceAddedEvent(Id, shipServiceId, shipId));
 }
Example #8
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LicensePlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ContainerId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ShipId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TrainId?.GetHashCode() ?? 0);
            return(hashCode);
        }
Example #9
0
        public void InitializeShipModel()
        {
            CreateModel(StartingPosition);
            InitializeSectors();
            InitializeShipBaseArc();

            SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString());

            SetShipInsertImage();
            SetShipSkin();
        }
Example #10
0
    public void RegisterShip(ShipId shipId)
    {
        shipId.Id = _idCounter;
        _shipIdDict[_idCounter] = shipId;
        var enemyShipController = shipId.GetComponent <EnemyShipController>();

        if (enemyShipController)
        {
            enemyShipController.gameSpace = gameSpace;
        }
        _idCounter++;
    }
Example #11
0
        private void GenerateModel(Vector3 position, Quaternion rotation)
        {
            GameObject prefab = Resources.Load <GameObject>("Prefabs/Remotes/" + RemoteInfo.Name);

            Model        = MonoBehaviour.Instantiate(prefab, position, rotation, BoardTools.Board.GetBoard());
            ShipAllParts = Model.transform.Find("RotationHelper/RotationHelper2/ShipAllParts").transform;

            SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString());
            SetRaycastTarget(true);
            SetSpotlightMask();
            SetShipIdText(Model);

            // InitializeShipBase();
        }
Example #12
0
        public virtual void InitializeShip()
        {
            InitializePilotForSquadBuilder();

            Shields = MaxShields;

            PrimaryWeapon = new PrimaryWeaponClass(this);
            Damage        = new AssignedDamageCards(this);

            CreateModel(StartingPosition);
            InitializeShipBaseArc();

            SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString());
        }
Example #13
0
        private void SetIdMarker()
        {
            string[] goNames = { "Front", "Rear" };
            string   idColor = (Owner.PlayerNo == Players.PlayerNo.Player1) ? "ID_White" : "ID_Black";

            foreach (string goName in goNames)
            {
                TextMesh ShipIdText = ShipAllParts.Find("ShipBase/ShipPeg/XWingNumberMarker" + goName + "/" + idColor).GetComponent <TextMesh>();
                ShipIdText.text = ShipId.ToString();
                if (Owner.PlayerNo == Players.PlayerNo.Player2)
                {
                    ShipAllParts.Find("ShipBase/ShipPeg/XWingNumberMarker" + goName).transform.localEulerAngles += new Vector3(0, 180, 0);
                }
            }
        }
Example #14
0
        public bool Equals(ShipLocation?other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(ShipLocationId == other.ShipLocationId && ShipId.Equals(other.ShipId) &&
                   Heading.Equals(other.Heading) && Speed == other.Speed && X == other.X && Y == other.Y &&
                   Created.Equals(other.Created));
        }
Example #15
0
        public GameObject CreateShipModel(Vector3 position)
        {
            Vector3 facing = (Owner.PlayerNo == Players.PlayerNo.Player1) ? ShipFactory.ROTATION_FORWARD : ShipFactory.ROTATION_BACKWARD;

            position = new Vector3(0, 0, (Owner.PlayerNo == Players.PlayerNo.Player1) ? -4 : 4);

            GameObject newShip = MonoBehaviour.Instantiate(Game.PrefabsList.ShipModel, position + new Vector3(0, 0.03f, 0), Quaternion.Euler(facing), Board.BoardManager.GetBoard());

            newShip.transform.Find("RotationHelper/RotationHelper2/ShipAllParts/ShipModels/" + Type).gameObject.SetActive(true);

            ShipId             = ShipFactory.lastId;
            ShipFactory.lastId = ShipFactory.lastId + 1;
            SetTagOfChildrenRecursive(newShip.transform, "ShipId:" + ShipId.ToString());
            SetShipIdText(newShip);

            return(newShip);
        }
 private InvoiceShipServiceAddedEvent(InvoiceId aggregateId, long aggregateVersion, ShipServiceId shipServiceId, ShipId shipId) : base(aggregateId, aggregateVersion)
 {
     ShipServiceId = shipServiceId;
     ShipId        = shipId;
 }
Example #17
0
 public ShipEquipmentUpdate(ShipId shipId, IReadOnlyList <EquipmentId?> equipmentIds)
 {
     ShipId       = shipId;
     EquipmentIds = equipmentIds;
 }
 internal InvoiceShipServiceAddedEvent(InvoiceId aggregateId, ShipServiceId shipServiceId, ShipId shipId) : base(aggregateId)
 {
     ShipServiceId = shipServiceId;
     ShipId        = shipId;
 }
Example #19
0
 public RepairStart(bool instantRepair, ShipId shipId, int repairingDockId)
 {
     InstantRepair   = instantRepair;
     ShipId          = shipId;
     RepairingDockId = repairingDockId;
 }