예제 #1
0
        public DisposalEntry(RouteStatus rs, int curDay, int curRoute)
        {
            InitializeComponent();

            // Disable the navigation bar
            NavigationPage.SetHasBackButton(this, false);

            // Create a message to listen for Jump Requests
            MessagingCenter.Subscribe <JumpToCustomer, int>(this, "JumpTo", (sender, arg) =>
            {
                _currentCustomerIndex = arg;
                UpdateRoutine(MoveDirection.Jump);
            });

            // Get the customer list for the day and route
            _currentDay         = curDay + 1;
            _currentRoute       = curRoute + 1;
            _routeDesc          = string.Format("Truck - {0}", _currentRoute);
            CurrentCustomerList = CCustomerList.GetCustomerListing(_currentDay, _currentRoute);

            // If the list comes back blank ... tell the user and go back
            if (CurrentCustomerList == null)
            {
                DisplayAlert("Customer List", "The customer list cannot be loaded.  The most likely cause is due to a missing file.  Please press the Update Customer List button and then try again.", "OK");
                Navigation.PopAsync();
            }

            // If this is a new route, clear every thing out
            if (rs == RouteStatus.StartNew)
            {
                CollectionRecord.DeleteDayAndRoute(_currentDay, _currentRoute);
            }

            // Fill in the other items that are collected
            ReadItemsToCollect();

            // Go to the first record
            UpdateRoutine(MoveDirection.Forward);

            // Set an event when those items are selected
            CurrentItemList.ItemSelected += (sender, e) =>
            {
                ItemsCollected colItem = (ItemsCollected)e.SelectedItem;
                if (colItem != null)
                {
                    CollectedItems.Add(new CollectionRecord(_currentCustomerId, _currentDay, _currentRoute, colItem.ID.ToString(), 1, colItem.ItemDescription, DateTime.Now, _routeDesc, colItem.MinimumPrice));
                }
                AddToList();
            };
        }
예제 #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <SpriteMovement>() == null)
        {
            return;
        }

        ItemsCollected.AddItems(itemsToAdd);

        // gameObject.GetComponent<AudioSource>().Play();

        // gameObject.GetComponent<AudioSource>().PlayOneShot(sound, volume);
        Destroy(gameObject);
    }
예제 #3
0
    /// <summary>
    /// Dumping the game state forces all properties to be initialized to their current state.
    /// </summary>
    /// <returns>The dump.</returns>
    public string Dump()
    {
        StringBuilder sb = new StringBuilder();

        sb.Append(CurrentRoom + "#");
        sb.Append(CurrentPosition.x.ToString() + "#");
        sb.Append(CurrentPosition.y.ToString() + "#");
        sb.Append(RestartPosition.x.ToString() + "#");
        sb.Append(RestartPosition.y.ToString() + "#");
        sb.Append(RoomStateSummary + "#");
        sb.Append(ItemsCollected.ToString() + "#");
        sb.Append(CreaturesKilled.ToString() + "#");
        sb.Append(LivesRemaining.ToString() + "#");
        sb.Append(InGameTime.ToShortTimeString() + "#");
        sb.Append(MaidGivenInstructions.ToString() + "#");
        sb.Append(MaidGivenWarning.ToString() + "#");
        sb.Append(MaidReceivedItems.ToString() + "#");
        sb.Append(BedReached.ToString() + "#");
        sb.Append(PlayerHasTheWeapon.ToString() + "#");
        sb.Append(DisableMusic.ToString() + "#");
        sb.Append(DisableSoundEffects.ToString() + "#");
        sb.Append(DifficultyMultiplier.ToString());
        return(sb.ToString());
    }
예제 #4
0
 private void ReadItemsToCollect()
 {
     CurrentItemList.ItemsSource = null;
     CurrentItemList.ItemsSource = ItemsCollected.GetItemsCollected();
 }
예제 #5
0
 protected Character(Cell cell) : base(cell)
 {
     Weapons        = new Weapons();
     ItemsCollected = new ItemsCollected();
 }