package me.blackphreak.Student.Types;

import me.blackphreak.Student.AbstractStudent;

import static me.blackphreak.Lib.*;

public class LocalStudent extends AbstractStudent {
	private String _HKID;
	
	public LocalStudent(String HKID) {
		this._HKID = HKID;
	}
	
	public LocalStudent() {
		do {
			var inp = promptQuestion("    HKID: ")
					.toUpperCase();
			
			// HKID regex pattern src: https://www.regextester.com/97968
			if (inp.isEmpty()
					|| inp.isBlank()
					|| !inp.matches("^[A-Z]{1,2}[0-9]{6}[0-9A-F]{1}"))
				System.out.println("Invalid HKID. Please try again.");
			else
				this.setHKID(inp);
		} while (this.getHKID() == null);
	}
	
	public String getHKID() {
		return _HKID;
	}
	
	public void setHKID(String HKID) {
		this._HKID = HKID;
	}
	
	@Override
	public void printInfoExtra() {
		System.out.println(String.format("    %13s: %s", "HKID", getHKID()));
	}
}
