United States (English)
Canada (English)
Canada (Français)
Deutschland (Deutsch)
España (Español)
France (Français)
Italia (Italia)
United Kingdom (English)
United States (English)
日本 (日本語)
Forums
Hi,
Visitor
Sign In
Home
Quick Start Guide
News
Membership
Games
Games Catalog
Submit Game
Review Game
Playtest Game
Creators
My Profile
My Business
Community
Forums
Community Spotlight
Community Resources
Education
Getting Started
Education Catalog
Starter Kits
Utilities
Academia
Developer Talk Series
Resources
FAQ
Partners
Download
Feedback
Press Site
Meet the Team
community forums
XNA Community Forums
»
XNA Game Studio Technologies (Windows Phone, Xbox 360, Windows, and Zune)
»
General
»
Inconsistent accessibility: error question
More Search Options
|
My Discussions
|
Active Topics
|
Not Read
Page 1 of 1 (3 items)
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
Inconsistent accessibility: error question
Last post 7/20/2007 7:08 PM by
JakeYankovic
. 2 replies.
7/20/2007 5:40 PM
JakeYankovic
(0)
Posts
2
Inconsistent accessibility: error question
Reply
Quote
I've been working on a Brick Break game and i wanted to add a level creator to it. I made it in another Windows game and I added a form to it so the user could select a level from 1 - 50 in a "numericUpDown" box. The problem that I have is that the bricks themselves are in an array of 150 brick class elements so I made a corresponding array of 150 brick elements in the form at first i just added a public method that you would sent the bricks array to from the main game like this
#CODE
namespace BrickBreakLevelCreator
{
public partial class LevelSave : Form
{
Brick[] bricks = Brick[150];
public LevelSave()
{
InitializeComponent();
}
public void sendBricks(Brick[] brick)
{//receive the bricks
bricks = brick;
}
private void cmd_ok_Click(object sender, EventArgs e)
{
//code to save level
}
}
}
but this gives me a
"Inconsistent accessibility: parameter type 'BrickBreakLevelCreator.Brick[]' is less accessible than method 'BrickBreakLevelCreator.LevelSave.sendBricks(BrickBreakLevelCreator.Brick[])'"
Error i checked the help and got this code
#CODE
public class A
{
// Try making B public since F is public
// B is implicitly private here
class B
{
}
public static void F(B b) // CS0051
{
}
public static void Main()
{
}
}
ok so i just made the brick array public and sent it after I called the form.Show() and i got this error
"Inconsistent accessibility: field type 'BrickBreakLevelCreator.Brick[]' is less accessible than field 'BrickBreakLevelCreator.LevelSave.bricks"
I checked the help and got this code
#CODE
class MyClass
// try the following line instead
// public class MyClass
{
}
public class MyClass2
{
public MyClass mf; // CS0052
}
public class MyClass3
{
public static void Main()
{
}
}
but it dosn't seem like this has any thing to do with what I'm trying to do here is a
link to the game
so if anyone could help it would be appreciate.
7/20/2007 5:57 PM
In reply to
qillerneu
(0)
Posts
25
Re: Inconsistent accessibility: error question
Answer
Reply
Quote
Check your Brick class definition, it should be public as well.
7/20/2007 7:08 PM
In reply to
JakeYankovic
(0)
Posts
2
Re: Inconsistent accessibility: error question
Reply
Quote
Thanks
Page 1 of 1 (3 items)
Previous
Next
© 2010 Microsoft Corporation. All rights reserved.
Terms of Use
Privacy Statement
Code of Conduct
Feedback