Convert from PHP

I am trying to convert a small PHP code to Xojo. The problem is, I know nothing about PHP.
Is there any converter, or even a PHP to “pseudo code” converter?

[code]<?php
/**

  • This class calculates ratings based on the Elo system used in chess.
  • @author Michal Chovanec michalchovaneceu@gmail.com
  • @copyright Copyright © 2012 - 2014 Michal Chovanec
  • @license Creative Commons Attribution 4.0 International License
    */

namespace Rating;
class Rating
{
/**
* @var int The K Factor used.
/
const KFACTOR = 16;
/
*
* Protected & private variables.
*/
protected $_ratingA;
protected $_ratingB;

protected $_scoreA;
protected $_scoreB;
protected $_expectedA;
protected $_expectedB;
protected $_newRatingA;
protected $_newRatingB;
/**
 * Costructor function which does all the maths and stores the results ready
 * for retrieval.
 *
 * @param int Current rating of A
 * @param int Current rating of B
 * @param int Score of A
 * @param int Score of B
 */
public function  __construct($ratingA,$ratingB,$scoreA,$scoreB)
{
    $this->_ratingA = $ratingA;
    $this->_ratingB = $ratingB;
    $this->_scoreA = $scoreA;
    $this->_scoreB = $scoreB;
    $expectedScores = $this -> _getExpectedScores($this -> _ratingA,$this -> _ratingB);
    $this->_expectedA = $expectedScores['a'];
    $this->_expectedB = $expectedScores['b'];
    $newRatings = $this ->_getNewRatings($this -> _ratingA, $this -> _ratingB, $this -> _expectedA, $this -> _expectedB, $this -> _scoreA, $this -> _scoreB);
    $this->_newRatingA = $newRatings['a'];
    $this->_newRatingB = $newRatings['b'];
}
/**
 * Set new input data.
 *
 * @param int Current rating of A
 * @param int Current rating of B
 * @param int Score of A
 * @param int Score of B
 */
public function setNewSettings($ratingA,$ratingB,$scoreA,$scoreB)
{
    $this -> _ratingA = $ratingA;
    $this -> _ratingB = $ratingB;
    $this -> _scoreA = $scoreA;
    $this -> _scoreB = $scoreB;
    $expectedScores = $this -> _getExpectedScores($this -> _ratingA,$this -> _ratingB);
    $this -> _expectedA = $expectedScores['a'];
    $this -> _expectedB = $expectedScores['b'];
    $newRatings = $this ->_getNewRatings($this -> _ratingA, $this -> _ratingB, $this -> _expectedA, $this -> _expectedB, $this -> _scoreA, $this -> _scoreB);
    $this -> _newRatingA = $newRatings['a'];
    $this -> _newRatingB = $newRatings['b'];
}
/**
 * Retrieve the calculated data.
 *
 * @return Array An array containing the new ratings for A and B.
 */
public function getNewRatings()
{
    return array (
        'a' => $this -> _newRatingA,
        'b' => $this -> _newRatingB
    );
}
/**
 * Protected & private functions begin here
 */
protected function _getExpectedScores($ratingA,$ratingB)
{
    $expectedScoreA = 1 / ( 1 + ( pow( 10 , ( $ratingB - $ratingA ) / 400 ) ) );
    $expectedScoreB = 1 / ( 1 + ( pow( 10 , ( $ratingA - $ratingB ) / 400 ) ) );
    return array (
        'a' => $expectedScoreA,
        'b' => $expectedScoreB
    );
}
protected function _getNewRatings($ratingA,$ratingB,$expectedA,$expectedB,$scoreA,$scoreB)
{
    $newRatingA = $ratingA + ( self::KFACTOR * ( $scoreA - $expectedA ) );
    $newRatingB = $ratingB + ( self::KFACTOR * ( $scoreB - $expectedB ) );
    return array (
        'a' => $newRatingA,
        'b' => $newRatingB
    );
}

}[/code]

See if this works for you…

http://shaosean.tk/files/rnd/EloRatingSystemClass.zip

I must say, I expected some guidance, not the work done!
But I am very gratefull !!
Thanks a lot

For others reference: http://en.wikipedia.org/wiki/Elo_rating_system#Mathematical_details

The Elo rating system is a method for calculating the relative skill levels of players in competitor-versus-competitor games such as chess. It is named after its creator Arpad Elo, a Hungarian-born American physics professor.

The Elo system was invented as an improved chess rating system and is also used in many other games. It is also used as a rating system for multiplayer competition in a number of video games,[1] and has been adapted to team sports including association football, gridiron football, basketball,[2] Major League Baseball, competitive programming, and esports.

The difference in the ratings between two players serves as a predictor of the outcome of a match. Two players with equal ratings who play against each other are expected to score an equal number of wins. A player whose rating is 100 points greater than their opponent’s is expected to score 64%; if the difference is 200 points, then the expected score for the stronger player is 76%.[3]

A player’s Elo rating is represented by a number which increases or decreases based upon the outcome of games between rated players. After every game, the winning player takes points from the losing one. The difference between the ratings of the winner and loser determines the total number of points gained or lost after a game. In a series of games between a high-rated player and a low-rated player, the high-rated player is expected to score more wins. If the high-rated player wins, then only a few rating points will be taken from the low-rated player. However, if the lower rated player scores an upset win, many rating points will be transferred. The lower rated player will also gain a few points from the higher rated player in the event of a draw. This means that this rating system is self-correcting. A player whose rating is too low should, in the long run, do better than the rating system predicts, and thus gain rating points until the rating reflects their true playing strength.