Moratelli's ToolBelt | TCG Engine
  • Moratelli's ToolBelt
  • Getting Started
    • Installation
    • Configuration
  • Tools
    • Card Editor
      • Demos
      • Customize
    • Game Helper
    • Card Finder
      • Configuration
    • Card Inspector
    • Duplicate Finder
    • Game State Visualizer
    • SO Creator
    • SO Finder
    • Card Gallery
  • Project Builder
Powered by GitBook
On this page
  • Setup
  • Attributes
  • Examples
  1. Tools

Game State Visualizer

The perfect tool to debug server data and find differences with client and UI.

PreviousDuplicate FinderNextSO Creator

Last updated 5 months ago

Setup

Add the following text on ServerManagerLocal.cs to allow GSV to get server data and compare with client data.

public GameServer GameServer { get { return server; } }

Remember to add using GSV;of top files to be able to use Attributes.

Attributes

  • GSVField:

    • Description: set special name to override field's name, also could be used as header of arrays/lists.

    • MaxWidth: set max width to make room for more fields in lines.

    • CompareField: set the field used to compare object from server and client data.

    • StripeLines: enable stripe lines for specific list.

    • CompareUI: set the field on CardUI to find respective object.

You must run the game to the tool get game data. After it was started once, it will keep the last updated data.

Examples

Game.cs

[GSVField]
public GameState state = GameState.Connecting;
[GSVField]
public GamePhase phase = GamePhase.None;

//Players
[GSVField(description:"Players", compare_field: "player_id")]
public Player[] players;

//Selector
[GSVField]
public SelectorType selector = SelectorType.None;
[GSVField]
public int selector_player_id = 0;
[GSVField]
public string selector_ability_id;
[GSVField]
public string selector_caster_uid;

Player.cs

[GSVField]
public int player_id;
[GSVField]
public int hp;
[GSVField]
public int hp_max;
[GSVField]
public int mana = 0;
[GSVField]
public int mana_max = 0;
[GSVField]
public int kill_count = 0;

[GSVField(description: "Deck", stripe_lines:true)]
public List<Card> cards_deck = new List<Card>();
[GSVField(description: "Hand", stripe_lines: true)]
public List<Card> cards_hand = new List<Card>();
[GSVField(description: "Board", stripe_lines: true)]
public List<Card> cards_board = new List<Card>();

Card.cs

[GSVField]
public string card_id;
[GSVField(max_width: 75)]
public Slot slot;

[GSVField]
public string card_id;
[GSVField(max_width: 75)]
public Slot slot;
[GSVField(max_width: 75)]
public int mana = 0;
[GSVField(max_width: 75)]
public int attack = 0;
[GSVField(max_width: 75)]
public int hp = 0;

The following code was added on Slot.cs to make it show a better value at GSV.

public override string ToString()
{
    return $"[{x},{y}]";
}