<commit_before>package ca.six.archi.demo.hsm

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    var parents: Array<IState> = arrayOf()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


    }
}

object UserState {
    var state = LoggedOut
}

interface IState {
    val parents: ArrayList<IState>
        get() = arrayListOf()
}

object LoggedOut : IState

object LoggedIn : IState

// = = = = = = = = = = =
object AbnormalUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object InsecureUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, AbnormalUser)
}

object LockedUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, AbnormalUser)
}

// = = = = = = = = = = =
object DepositUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object InvestUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object DepositRegularUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, DepositUser)
}

object DepositVipUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, DepositUser)
}

object InvestRegularUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, InvestUser)
}

object InvestVipUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, InvestUser)
}<commit_msg>refactor the states<commit_after>package ca.six.archi.demo.hsm

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    var parents: Array<IState> = arrayOf()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


    }
}

object UserState {
    var state = LoggedOut
}

interface IState {
    val parents: ArrayList<IState>
        get() = arrayListOf()
}

object LoggedOut : IState

object LoggedIn : IState

// = = = = = = = = = = =
object RegularUser: IState
object VipUser: IState

object AbnormalUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object InsecureUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, AbnormalUser)
}

object LockedUser : IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, AbnormalUser)
}

// = = = = = = = = = = =
object DepositUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object InvestUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn)
}

object DepositRegularUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, DepositUser, RegularUser)
}

object DepositVipUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, DepositUser, VipUser)
}

object InvestRegularUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, InvestUser, RegularUser)
}

object InvestVipUser: IState {
    override val parents: ArrayList<IState>
        get() = arrayListOf(LoggedIn, InvestUser, VipUser)
}
{'fraction_non_alphanumeric': 0.10343863572826391, 'fraction_numerical': 0.0, 'mean_word_length': 3.6588541666666665, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4739852', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1118, 'n_words': 260}