You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
2.3 KiB
122 lines
2.3 KiB
<?php
|
|
namespace App\Entity;
|
|
|
|
use ApiPlatform\Metadata\ApiProperty;
|
|
use Doctrine\ORM\Mapping\Column;
|
|
use Doctrine\ORM\Mapping\Entity;
|
|
use Doctrine\ORM\Mapping\JoinColumn;
|
|
use Doctrine\ORM\Mapping\ManyToOne;
|
|
|
|
#[Entity(repositoryClass: 'App\Repository\TechniqueRepository')]
|
|
class Technique extends Thing
|
|
{
|
|
|
|
#[Column(unique: true)]
|
|
public string $name;
|
|
|
|
/**
|
|
* For now we calculate costs for mastering a technique.
|
|
*/
|
|
#[Column]
|
|
public int $costs;
|
|
|
|
/**
|
|
* Formula to calculate the damage based on the stats.
|
|
*/
|
|
#[Column]
|
|
public string $damage;
|
|
|
|
/**
|
|
* Formula to calculate the consumed energy on use based on the stats.
|
|
*/
|
|
#[Column]
|
|
public string $energy;
|
|
|
|
/**
|
|
* Formula to calculate the hit chance accuracy based on the stats.
|
|
*/
|
|
#[Column]
|
|
public string $accuracy;
|
|
|
|
/**
|
|
* Technique that is required to be learned before this Technique.
|
|
*/
|
|
#[ManyToOne()]
|
|
#[JoinColumn(onDelete: 'SET NULL', nullable: true)]
|
|
#[ApiProperty(readableLink: false, writableLink: false)]
|
|
public ?Technique $prerequisite;
|
|
|
|
public function getCosts(): ?int
|
|
{
|
|
return $this->costs;
|
|
}
|
|
|
|
public function setCosts(int $costs): static
|
|
{
|
|
$this->costs = $costs;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDamage(): ?string
|
|
{
|
|
return $this->damage;
|
|
}
|
|
|
|
public function setDamage(string $damage): static
|
|
{
|
|
$this->damage = $damage;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEnergy(): ?string
|
|
{
|
|
return $this->energy;
|
|
}
|
|
|
|
public function setEnergy(string $energy): static
|
|
{
|
|
$this->energy = $energy;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAccuracy(): ?string
|
|
{
|
|
return $this->accuracy;
|
|
}
|
|
|
|
public function setAccuracy(string $accuracy): static
|
|
{
|
|
$this->accuracy = $accuracy;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getPrerequisite(): ?self
|
|
{
|
|
return $this->prerequisite;
|
|
}
|
|
|
|
public function setPrerequisite(?self $prerequisite): static
|
|
{
|
|
$this->prerequisite = $prerequisite;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): static
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
}
|
|
|