How to add an item to a list with a class/uJS struct?

I been trying to add a player to the list via .Add but nothing i do seems to work. So how would i add a player to that list?

import System.Collections.Generic; 

var NumOfPlayers : int;
var PlayerTurn : boolean;
var Player :List.<PlayerInfo>;

class PlayerInfo{
	var Name : String;
	var Level : int;
	var HP : int;
	var TP : int;
	var ATK : int;
	var DEF : int;
}

function Start () {
Player.Add("Bob", 1, 10, 5, 10, 5);
}

function OnGUI(){

}

function Update () {

}

Thank you in advance.

Your class needs a constructor to build the struct. It works well in uJS to extend System.ValueType.

Notice how the function matches the classname and how the values are passed as arguments to build your PlayerInfo.

//Making your own struct in uJS
#pragma strict
 
class PlayerInfo extends System.ValueType {
    var Name : String;
    var Level : int;
    var HP : int;
    var TP : int;
    var ATK : int;
    var DEF : int;
 
	public function PlayerInfo( Name : String,
								Level : int,
								HP : int,
								TP : int,
								ATK : int,
								DEF : int )
								{
									this.Name = Name;
									this.HP = HP;
									this.TP = TP;
									this.ATK = ATK;
									this.DEF = DEF;
								}
}

//Basic List Examples     
#pragma strict
import System.Collections.Generic;

public class ListTest extends MonoBehaviour
{
	public var PlayerList :List.<PlayerInfo>;
	private var paddingZero : PlayerInfo = PlayerInfo("ZeroElement", 0, 0, 0, 0, 0);

	function Start ()
	{
		AddPlayerInfo(paddingZero);
	}

	function Update()
	{
		if(Input.GetKeyDown(KeyCode.Y))
		{
			AddPlayerInfo(paddingZero);
		}
		if(Input.GetKeyDown(KeyCode.U))
		{
			ChangeInfo("Steve", 2);
		}
		if(Input.GetKeyDown(KeyCode.I))
		{
			RemoveBlock(0);
		}
	}

	function AddPlayerInfo(myPlayer : PlayerInfo)
	{
		this.PlayerList.Add(myPlayer);
	}
	 
	public function RemoveBlock(playerIndex : int)
	{
		this.PlayerList.RemoveAt(playerIndex);
	}

	public function ChangeInfo(newName : String, playerID : int)
	{
		if(PlayerList[playerID] != null)
		{
			var tempHolder : PlayerInfo;
			tempHolder = this.PlayerList[playerID];
			tempHolder.Name = newName;
			this.PlayerList[playerID] = tempHolder;
		}
	}
}