Example #1
0
        private GameObject GetMark(EMarkType type, long id)
        {
            GameObject item = null;
            var        dict = _markPool[type];

            return(dict.TryGetValue(id, out item) ? item : CreateMark(type, id));
        }
Example #2
0
 public Cell(Cell src)
 {
     Value = src.Value;
     Round = src.Round;
     Type  = src.Type;
     Array.Copy(src.possible, possible, possible.Length);
 }
Example #3
0
 protected Finding(Position position, uint value, uint round, EMarkType type)
 {
     Position = position;
     Value    = value;
     Round    = round;
     Type     = type;
 }
Example #4
0
        private GameObject CreateMark(EMarkType type, long id)
        {
            var origTf = _origGoDict[type];
            var dict   = _markPool[type];
            var newGo  = UnityEngine.Object.Instantiate(origTf, _root, false);

            dict[id] = newGo;
            return(newGo);
        }
Example #5
0
 public void Clone(Cell src)
 {
     Value = src.Value;
     Round = src.Round;
     Type  = src.Type;
     for (int i = 0; i < possible.Length; i++)
     {
         possible[i] = src.possible[i];
     }
 }
Example #6
0
        public void Mark(uint value, uint round, EMarkType type)
        {
            Value = value;
            Round = round;
            Type  = type;

            for (int v = 0; v < possible.Length; v++)
            {
                if (possible[v] == 0)
                {
                    possible[v] = round;
                }
            }
        }
Example #7
0
 private void UpdatePos(EMarkType type, List <long> idList)
 {
     foreach (var id in idList)
     {
         var pos = adapter.GetTopPos(id);
         var go  = GetMark(type, id);
         if (pos != null && UIUtils.InView(pos.Value))
         {
             var pos2D = UIUtils.WorldPosToRect(pos.Value, CanvasRect);
             (go.transform as RectTransform).anchoredPosition = pos2D;
             UIUtils.SetActive(go, true);
         }
         else
         {
             UIUtils.SetActive(go, false);
         }
     }
 }
Example #8
0
        public void AddNote(EMarkType _mark)
        {
            if (RhythmPattern.Count > 0)
            {
                RhythmPattern[RhythmPattern.Count - 1].BeatBeforeNextNote = m_BeatCountBuffer + (m_IsHalfBeat ? 0.5f : 0f);
                if (RhythmPattern[RhythmPattern.Count - 1].BeatBeforeNextNote == 0)
                {
                    RhythmPattern[RhythmPattern.Count - 1].BeatBeforeNextNote = 0.5f;
                }
            }

            m_BeatCountBuffer = 0;

            switch (_mark)
            {
            case EMarkType.Rythm1:
                RythmoPlay1();
                break;

            case EMarkType.Rythm2:
                RythmoPlay2();
                break;

            case EMarkType.Rythm3:
                RythmoPlay3();
                break;

            case EMarkType.Back:
                UndoRhythmAndExit();
                return;

            case EMarkType.Save:
                SaveRhythmAndExit();
                return;

            default:
                break;
            }

            RhythmPattern.Add(new RhythmMark(_mark, 0));
            m_CanBeat = true;
        }
Example #9
0
        private void UpdateVisible(EMarkType type, List <long> idList)
        {
            var origList = _idListCache[type];

            if (origList.SetEquals(idList))
            {
                return;
            }

            var newList = new HashSet <long>(idList);

            origList.ExceptWith(idList);
            _idListCache[type] = newList;

            foreach (var id in origList)
            {
                UIUtils.SetActive(GetMark(type, id), false);
            }

            //foreach (var id in newList)
            //{
            //    UIUtils.SetActive(GetMark(type, id), true);
            //}
        }
Example #10
0
 public FoundImpossibility(Position position, uint value, uint round, EMarkType type)
     : base(position, value, round, type)
 {
 }
Example #11
0
 public FoundValue(Position position, uint value, uint round, EMarkType type)
     : base(position, value, round, type)
 {
 }
Example #12
0
 public RhythmMark(EMarkType _noteIndex, float _beatElasped)
 {
     Note = _noteIndex;
     BeatBeforeNextNote = _beatElasped;
 }