Yannick Guern (RMN) 6 سال پیش
والد
کامیت
7642ecc54c
4فایلهای تغییر یافته به همراه121 افزوده شده و 0 حذف شده
  1. 4 0
      .gitignore
  2. 13 0
      composer.json
  3. 43 0
      src/AshlaLib.php
  4. 61 0
      src/Position.php

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+# Created by .ignore support plugin (hsz.mobi)
+.idea
+composer.phar
+vendor

+ 13 - 0
composer.json

@@ -0,0 +1,13 @@
+{
+    "name": "ashla/aiming",
+    "type": "library",
+    "minimum-stability": "stable",
+    "require": {
+      "php" : "^7.2"
+    },
+    "autoload": {
+        "psr-4": {
+            "Ashla\\" : "src/"
+        }
+    }
+}

+ 43 - 0
src/AshlaLib.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Noa
+ * Date: 10/08/2018
+ * Time: 09:35
+ */
+
+namespace Ashla;
+
+
+class AshlaLib
+{
+    /**
+     * AshlaLib constructor.
+     * @param string $model - The device model
+     */
+    public function __construct(string $model)
+    {
+        // Stub version for client
+    }
+
+    /**
+     * @return array<Position> - The position max and min of the target
+     */
+    public function getTargetPosition() : array {
+        // Stub version for client
+    }
+
+    /**
+     * @return Position - The position of the shooter
+     */
+    public function getShooterPosition() : Position {
+        // Stub version for client
+    }
+
+    /**
+     * @return float
+     */
+    public function getInitialVelocity() : float {
+        // Stub version for client
+    }
+}

+ 61 - 0
src/Position.php

@@ -0,0 +1,61 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Noa
+ * Date: 10/08/2018
+ * Time: 09:36
+ */
+
+namespace Ashla;
+
+
+class Position
+{
+    private $x = 0;
+    private $y = 0;
+
+    /**
+     * Position constructor.
+     * @param float $x
+     * @param float $y
+     */
+    public function __construct(float $x, float $y)
+    {
+        $this->x = $x;
+        $this->y = $y;
+    }
+
+    /**
+     * @return float|float|int
+     */
+    public function getX()
+    {
+        return $this->x;
+    }
+
+    /**
+     * @param float|float|int $x
+     */
+    public function setX($x)
+    {
+        $this->x = $x;
+    }
+
+    /**
+     * @return float|float|int
+     */
+    public function getY()
+    {
+        return $this->y;
+    }
+
+    /**
+     * @param float|float|int $y
+     */
+    public function setY($y)
+    {
+        $this->y = $y;
+    }
+
+
+}