|
|
#2 | |
|
вункердырдыр
|
Re: Уголок программирующего слона
![]() public class MapSet { public static int MapSizeXset; public static int MapSizeYset; public static int[] Blockset; public MapSet(int MapSizeXset, int MapSizeYset, int[] Blockset) { this.MapSizeXset = MapSizeXset; this.MapSizeYset = MapSizeYset; this.Blockset = Blockset; } } static void Main() { MapSet bla1 = new MapSet(10,10,{1,1,1}); MapSet bla2 = new MapSet(20,20,{2,2,2}); } |
|
|
|
|
#9 | |
|
Скрепный имперец
|
Re: Уголок программирующего слона
using UnityEngine;
using System.Collections; using System; using System.IO; public class Map { MapSet bla1 = new MapSet(10,10,{1,1,1,1,1}); public class MapSet { public static int MapSizeXset; public static int MapSizeYset; public static int[] Blockset; public MapSet(int MapSizeXset, int MapSizeYset, int[] Blockset) { this.MapSizeXset = MapSizeXset; this.MapSizeYset = MapSizeYset; this.Blockset = Blockset; } } } Мож компилятор гавно? |
|
|
|
|
#18 | |
|
вункердырдыр
|
Re: Уголок программирующего слона
вот такой нулевый файл заведи
using System; namespace ConsoleApplication1 { class Class1 { static void Main() { MapSet bla1 = new MapSet(10,10,{1,1,1,1,1}); } class MapSet { public static int MapSizeXset; public static int MapSizeYset; public static int[] Blockset; public MapSet(int MapSizeXset, int MapSizeYset, int[] Blockset) { this.MapSizeXset = MapSizeXset; this.MapSizeYset = MapSizeYset; this.Blockset = Blockset; } } } }
__________________
Последний раз редактировалось spens; 18.01.2013 в 15:29. Причина: Добавлено сообщение |
|
|
|
|
#19 | |
|
Скрепный имперец
|
Re: Уголок программирующего слона
Да он чо то { не переваривает из за етого не присваевается массив я аще ваxуе.
Во чо придумал: using UnityEngine; using System.Collections; using System; using System.IO; public class Map { public void MakeMap1() { int[] i = {1,1,1,1}; MapSet Map1 = new MapSet(10,10,i); } public void MakeMap2() { int[] i = {2,2,2,2}; MapSet Map2 = new MapSet(10,10,i); } public class MapSet { public static int MapSizeXset; public static int MapSizeYset; public static int[] Blockset; public MapSet(int MapSizeXset, int MapSizeYset, int[] Blockset) { this.MapSizeXset = MapSizeXset; this.MapSizeYset = MapSizeYset; this.Blockset = Blockset; } } } Прокатит? |
|
|
|
|
#20 | |
|
вункердырдыр
|
Re: Уголок программирующего слона
блять ты вынудил меня поставить шарп
на using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MapSet bla1 = new MapSet(10, 10, new int[] { 1, 1, 1, 1, 1 }); } } class MapSet { public int MapSizeXset; public int MapSizeYset; public int[] Blockset; public MapSet(int MapSizeXset, int MapSizeYset, int[] Blockset) { this.MapSizeXset = MapSizeXset; this.MapSizeYset = MapSizeYset; this.Blockset = Blockset; } } } Добавлено через 29 секунд отсюда вывод: перед тем как использовать массив его нужно инициализировать Добавлено через 42 секунды с тебя крушовице
__________________
Последний раз редактировалось spens; 18.01.2013 в 15:56. Причина: Добавлено сообщение |
|
|
|
|
#21 | |
|
Оккупант таверны АА
|
Re: Уголок программирующего слона
Хммм...таки в Таверне теперь процветает "кумовство"? Так и запишем.
__________________
And I heard a voice in the midst of the four beasts. And I looked and behold, a pale horse, and it's name it said on him was Death, and Hell followed with him.
|
|
|
|
|
#22 | |
|
Скрепный имперец
|
Re: Уголок программирующего слона
Крушовице с зарплаты, блеать. Добавлено через 5 минут Assets/Scripts/Map.cs(21,22): error CS0176: Static member `Map.MapSet.MapSizeXset' cannot be accessed with an instance reference, qualify it with a type name instead А ето че за гавно?
__________________
Последний раз редактировалось DrSlon; 18.01.2013 в 16:05. Причина: Добавлено сообщение |
|
|
|
|
#23 | |
|
Оккупант таверны АА
|
Re: Уголок программирующего слона
Ну очевидно крушовице откладывается, а ты пойдешь искать другую работу.
__________________
And I heard a voice in the midst of the four beasts. And I looked and behold, a pale horse, and it's name it said on him was Death, and Hell followed with him.
|
|
|