C#C
C#12mo ago
28 replies
cowbloke

✅ inaccessible due to its protection level error when the const i'm reaching is public

using Godot;
using System;
using ChessEngine;
using System.Collections.Generic;

public partial class GodotBridge : Node
{
    ChessBoard board = new ChessBoard(); // Create the main instance of the ChessBoard
    MoveGenerator MoveGenerator = new MoveGenerator(); // Create a movegenerator
    FenParser fenParser = new FenParser(); // Create an instance of FenParser

    public override void _Ready()
    {
        PrecomputedMoveData.PrecomputeMoveData();
        board = fenParser.ParseFen(FenParser.startingFen); // Use the type name to call startingFen <-- error here

        Console.WriteLine(MoveGenerator.GenerateMoves(board));
    }

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public List<Move> GetMoves()
    {

        return MoveGenerator.GenerateMoves(board);
    }
}


fenparser.cs :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessEngine
{
    public class FenParser
    {

        public const string startingFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
Was this page helpful?