示例#1
0
		internal FiscalCode(
			LastNameCode lastNameCode,
			FirstNameCode firstNameCode,
			YearCode yearCode,
			MonthCode monthCode,
			DayCode dayCode,
			AreaCode areaCode,
			ControlCode controlCode)
			: this(
				lastNameCode.ToString(),
				firstNameCode.ToString(),
				yearCode.ToString(),
				monthCode.ToString(),
				dayCode.ToString(),
				areaCode.ToString(),
				controlCode.ToString())
		{
		}
示例#2
0
 public FiscalCode(
     LastNameCode lastNameCode,
     FirstNameCode firstNameCode,
     YearCode yearCode,
     MonthCode monthCode,
     DayCode dayCode,
     AreaCode areaCode,
     ControlCode controlCode)
     : this(
         lastNameCode.ToString(),
         firstNameCode.ToString(),
         yearCode.ToString(),
         monthCode.ToString(),
         dayCode.ToString(),
         areaCode.ToString(),
         controlCode.ToString())
 {
 }
示例#3
0
        private char[] GetControlCode(ControlCode code, EndianBinaryReader reader, Dictionary <ControlCode, string> codeDict)
        {
            List <char> codeBank = new List <char>();

            if (codeDict.First(x => x.Key == code).Value.Count() == 1)
            {
                codeBank.AddRange(codeDict[code].ToCharArray());
                return(codeBank.ToArray());
            }

            string codeInsides = "";

            switch (code)
            {
            case ControlCode.Color:
                Color col = (Color)reader.ReadByte();
                codeInsides = col.ToString();
                break;

            case ControlCode.Icon:
                byte iconID = reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "Icon", iconID);
                break;

            case ControlCode.Line_Break:
                return("\n".ToCharArray());

            case ControlCode.Spaces:
                byte numSpaces = reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "Pixels Right", numSpaces);
                break;

            case ControlCode.Delay:
                byte numFrames = reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "Delay", numFrames);
                break;

            case ControlCode.Fade:
                byte numFramesFade = reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "Fade", numFramesFade);
                break;

            case ControlCode.Sound:
                SoundType soundID = (SoundType)reader.ReadInt16();
                codeInsides = string.Format("{0}:{1}", "Sound", soundID.ToString().Replace("_", " "));
                break;

            case ControlCode.Speed:
                byte speed = reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "Speed", speed);
                break;

            case ControlCode.High_Score:
                HighScore scoreID = (HighScore)reader.ReadByte();
                codeInsides = string.Format("{0}:{1}", "High Score", scoreID.ToString().Replace("_", " "));
                break;

            case ControlCode.Jump:
                short msgID = reader.ReadInt16();
                codeInsides = string.Format("{0}:{1:X4}", "Jump", msgID);
                break;

            case ControlCode.Box_Break:
                return("\n<New Box>\n".ToCharArray());

            case ControlCode.No_Skip:
                codeInsides = "NS";
                break;

            case ControlCode.Draw_Instant:
                codeInsides = "DI";
                break;

            case ControlCode.Draw_Char:
                codeInsides = "DC";
                break;

            case ControlCode.Background:
                int  backgroundID;
                byte id1 = reader.ReadByte();
                byte id2 = reader.ReadByte();
                byte id3 = reader.ReadByte();
                backgroundID = BitConverter.ToInt32(new byte[] { id3, id2, id1, 0 }, 0);
                codeInsides  = string.Format("{0}:{1}", "Background", backgroundID);
                break;

            default:
                codeInsides = code.ToString().Replace("_", " ");
                break;
            }

            codeBank.AddRange(string.Format("<{0}>", codeInsides).ToCharArray());

            return(codeBank.ToArray());
        }