Exemplo n.º 1
0
    void Awake()
    {
        var md = GameObject.Find("MainData");

        mineDatas = md.GetComponent <MainData>().mineDatas;
        var gamePart = md.GetComponent <GamePart>();

        flipBoard            = gamePart.flipBoard;
        map                  = new List2DInt(mineDatas.XSize, mineDatas.YSize, -1);
        insideMap            = new List2DInt(mineDatas.XSize, mineDatas.YSize, -1);
        numberList           = new SmartList <HCArea>();
        unFlipAreaList       = new SmartList <HCArea>();
        unFlipAreaInsideList = new SmartList <IndexOfList2D>();
        for (int i = 0; i < map.XSize; i++)
        {
            for (int j = 0; j < map.YSize; j++)
            {
                insideMap[i, j] = unFlipAreaInsideList.Add(new IndexOfList2D(i, j));
            }
        }
        gamePart.flipAction += ChangeMapByFlip;

        GameObject debugWithMap = new GameObject("Map");

        debugWithMap.transform.parent = transform;
        debugWithMap.AddComponent(typeof(WatchList2DInScene));
        debugWithMap.GetComponent <WatchList2DInScene>().list = map;
        debugWithMap = new GameObject("InsideMap");
        debugWithMap.transform.parent = transform;
        debugWithMap.AddComponent(typeof(WatchList2DInScene));
        debugWithMap.GetComponent <WatchList2DInScene>().list = insideMap;
    }
Exemplo n.º 2
0
        public static SmartList <IField> GetFieldsByAttribute(this IAttribute attribute)
        {
            var list = new SmartList <IField>();

            foreach (var fieldDeclaration in FieldDeclarationNavigator.GetByAttribute(attribute))
            {
                if (fieldDeclaration.DeclaredElement != null)
                {
                    list.Add(fieldDeclaration.DeclaredElement);
                }
            }
            foreach (var constantDeclaration in ConstantDeclarationNavigator.GetByAttribute(attribute))
            {
                if (constantDeclaration.DeclaredElement != null)
                {
                    list.Add(constantDeclaration.DeclaredElement);
                }
            }

            return(list);
        }
Exemplo n.º 3
0
 public void AddNumber(HCArea number)
 {
     map[number.pos] = -2 - numberList.Add(number);
 }
Exemplo n.º 4
0
 public void AddUnflipArea(HCArea ufa)
 {
     map[ufa.pos] = unFlipAreaList.Add(ufa);
 }