<?php


namespace App\Model\Crates\WorldOfWarcraft;


use stdClass;

class Race
{
    /** @var stdClass */
    protected $data;

    /**
     * BattleNetProfile constructor.
     * @param $data
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

    public function getId()
    {
        $id = $this->data->id;

        if ($id == 25 || $id == 26) {
            return 24;                  // multiple pandaren race fix
        }

        return $id;
    }

    public function getName()
    {
        return $this->data->name;
    }

    public function getSide()
    {
        if ($this->getId() == 24) {
            return 'neutral';           // multiple pandaren race fix
        }

        return $this->data->side;
    }
}