예제 #1
0
파일: ShortNote.cs 프로젝트: TinyTany/MADCA
        public static ShortNote Factory(JsonObject json)
        {
            var noteType = NoteType.Parse(typeof(NoteType), json["NoteType"]);

            switch (noteType)
            {
            case NoteType.Touch:
            {
                var note = new Touch(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            case NoteType.Chain:
            {
                var note = new Chain(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            case NoteType.SlideL:
            {
                var note = new SlideL(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            case NoteType.SlideR:
            {
                var note = new SlideR(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            case NoteType.SnapU:
            {
                var note = new SnapU(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            case NoteType.SnapD:
            {
                var note = new SnapD(new LanePotision(0), new TimingPosition(1, 0), new NoteSize(1));
                note.Exchange(json);
                return(note);
            }

            default:
                Debug.Assert(false);
                return(null);
            }
        }