Player Xp Property Delta Engine Documentation

Namespace: CreepyTowers
Assembly: CreepyTowers (in CreepyTowers.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public int Xp { get; }

Property Value

Type: Int32
Remarks

Tests: CreepyTowers.Tests.PlayerTests
Examples

2 unit tests call CreepyTowers.Player.Xp
[Test, CloseAfterFirstFrame]
public void TotalPlayerXpIsSumOfAvatarXp()
{
    player.Avatar.Xp = 10;
    Assert.AreEqual(10, player.Avatar.Xp);
    player.UnlockAvatar(CreepyTowers.Content.Avatars.Penguin);
    player.ChangeAvatar(CreepyTowers.Content.Avatars.Penguin);
    player.Avatar.Xp = 25;
    Assert.AreEqual(25, player.Avatar.Xp);
    Assert.AreEqual(35, player.Xp);
}
[Test, CloseAfterFirstFrame]
public void SwitchingBackToOldAvatarRestoresOldAvatarAndData()
{
    player.Avatar.Xp = 10;
    player.Avatar.ProgressLevel = 2;
    player.UnlockAvatar(CreepyTowers.Content.Avatars.PiggyBank);
    player.ChangeAvatar(CreepyTowers.Content.Avatars.PiggyBank);
    player.Avatar.Xp = 25;
    player.Avatar.ProgressLevel = 4;
    player.ChangeAvatar(CreepyTowers.Content.Avatars.Dragon);
    Assert.AreEqual(10, player.Avatar.Xp);
    Assert.AreEqual(2, player.Avatar.ProgressLevel);
}
See Also