Beispiel #1
0
    protected override void Start()
    {
        base.Start();
        StateLoader stateLoader = FindObjectOfType <StateLoader>();

        if (stateLoader)
        {
            weapon = stateLoader.gameState.Weapon;
        }
    }
 private void Awake()
 {
     if (saveSystem == null)
     {
         DontDestroyOnLoad(gameObject); //makes instance persist across scenes
         saveSystem = this;
     }
     else if (saveSystem != this)
     {
         Destroy(gameObject); //deletes copies of global which do not need to exist, so right version is used to get info from
     }
 }
Beispiel #3
0
    private void Start()
    {
        DontDestroyOnLoad(this);
        StateLoader otherLoader = FindObjectsOfType <StateLoader>().FirstOrDefault(loader => loader != this);

        if (!otherLoader)
        {
            Destroy(gameObject);
        }
        if (otherLoader && gameState)
        {
            LoadState(gameState);
        }
    }
Beispiel #4
0
        public override async Task <IState?> GetStateSnapshotAsync()
        {
            var state = await StateLoader.GetStateSnapshotAsync();

            if (state == null)
            {
                return(null);
            }

            var itemState = (AuctionItemState)state.Data;
            var records   = itemState.BiddingRecords;

            itemState.InitBiddingRecords();
            if (records != null)
            {
                foreach (var(key, value) in records)
                {
                    itemState.BiddingRecords.Add(key, value);
                }
            }

            return(state);
        }
Beispiel #5
0
 public Uninitialized(string jsonString, StateLoader stateLoader)
 {
     this.stateLoader = stateLoader;
     this.jsonString  = jsonString;
 }
Beispiel #6
0
 internal PatchRun_InProgress(string jsonString, StateLoader stateLoader)
 {
     this.jsonString  = jsonString;
     this.stateLoader = stateLoader;
 }
Beispiel #7
0
 //to pass on to the next state
 internal ReAssessment_InProgress(string jsonString, StateLoader stateLoader)
 {
     this.jsonString  = jsonString;
     this.stateLoader = stateLoader;
 }
Beispiel #8
0
 //to pass on to the next state
 internal Cleanup_Started(string jsonString, StateLoader stateLoader)
 {
     this.jsonString  = jsonString;
     this.stateLoader = stateLoader;
 }
Beispiel #9
0
        public static void Main(string[] args)
        {
            StateLoader loader = new StateLoader();

            loader.TransitionState();
        }
Beispiel #10
0
 internal PatchRun_Created(string jsonString, StateLoader stateLoader)
 {
     this.jsonString  = jsonString;
     this.stateLoader = stateLoader;
 }