Esempio n. 1
0
        public string GenerateCellDebugInfo(Tile tile)
        {
            var sb     = new StringBuilder();
            var status = _world.GetTileCollisions(tile);

            sb.AppendFormat("* Tile:            {0} ({1})\n", tile.Type, tile.GetType());
            sb.AppendFormat("* Name:            {0} (#{1})\n", tile.Name, tile.GetInstanceId());
            sb.AppendFormat("* Position:        {0}\n", tile.Position);
            sb.AppendFormat("* Rotation:        {0}\n", Mathf.Rad2Deg(tile.Rotation));
            sb.AppendFormat("* State:           {0}\n", tile.MoveState);
            sb.AppendFormat("* Last direction:  {0}\n", tile.LastDirection);
            sb.AppendFormat("* Priority:        {0}\n", tile.Priority);
            sb.AppendFormat("* Target position: {0}\n", tile.TargetPosition);
            sb.AppendFormat("* Target rotation: {0}\n", Mathf.Rad2Deg(tile.TargetRotation));
            sb.AppendFormat("* Cell Position:   {0}\n", _world.GetTileCurrentGridPosition(tile));
            sb.AppendFormat("* Tile layer:      {0}\n", DebugDrawUtils.ShowWithColor(tile.TileLayer, Colors.Yellow));
            sb.AppendFormat("* Direction:       {0}\n", DebugDrawUtils.ShowTileDirection(tile.NextDirection));
            sb.Append(GenerateCollisionDebugInfo(status));

            // Explosion info
            if (tile.CanExplode && tile.WillExplodeAtTick != -1)
            {
                sb.AppendFormat(
                    "{0} {1}\n",
                    DebugDrawUtils.ShowWithColor("* Will explode at tick: ", Colors.Red),
                    DebugDrawUtils.ShowWithColor(tile.WillExplodeAtTick + 1, Colors.Red)
                    );
            }

            sb.Append(tile.GenerateTileDebugInfo(status));
            return(sb.ToString());
        }
Esempio n. 2
0
        public override string GenerateTileDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Last direction: {0}\n", DebugDrawUtils.ShowTileDirection(_lastDirection));
            sb.AppendFormat("* Can go up:      {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            sb.AppendFormat("* Can push up:    {0}\n", DebugDrawUtils.ShowBool(CanPushUp()));
            sb.AppendFormat("* Can go down:    {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            return(sb.ToString());
        }