public void Dispose()
 {
     TrashCan.Throw(ref enumerator);
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     TrashCan.Throw(ref batchCursor);
     TrashCan.Throw(ref asyncCursor);
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     TrashCan.Throw(ref jsonReader, r => r.Close());
     TrashCan.Throw(ref file, f => f.Close());
 }
Ejemplo n.º 4
0
 public void Dispose()
 {
     TrashCan.Throw(ref random);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
 }
Ejemplo n.º 6
0
 private void RequestNextChunk()
 {
     TrashCan.Throw(ref chunkCursor);
     chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>();
 }
Ejemplo n.º 7
0
 public override void Stop()
 {
     base.Stop();
     TrashCan.Throw(ref errorLogSynchronizedWriter);
     TrashCan.Throw(ref errorLogStreamWriter);
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     instance   = this;
     trashCards = new List <Sprite>();
 }
Ejemplo n.º 9
0
 protected virtual void ErrorClear()
 {
     TrashCan.AddRange(_errors); // for testing and other purposes
     _errors.Clear();
 }
Ejemplo n.º 10
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 11
0
 public override void Stop()
 {
     base.Stop();
     TrashCan.Throw(ref errorLogWriter);
     TrashCan.Throw(ref errorLogStream);
 }
 public void Dispose()
 {
     TrashCan.Throw(ref currentScope);
 }
        public void Dispose()
        {
            Disposed = true;

            TrashCan.Throw(ref batches);
        }
 public void Dispose()
 {
     TrashCan.Throw(ref rowsCursor);
 }
Ejemplo n.º 15
0
 private void RequestNextChunk(CancellationToken cancellation)
 {
     TrashCan.Throw(ref chunkCursor);
     chunkDownloadTask = documentQuery.ExecuteNextAsync <TIn>(cancellation);
 }
Ejemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        if (itemHeld != null)//holding an item
        {
            itemHeld.transform.position = transform.position + (transform.forward * .75f);
            animator.SetBool("Carrying", true);
        }
        else
        {
            animator.SetBool("Carrying", false);
        }
        //this code just looks at what you're seeing
        Ray ray = new Ray(transform.position + (Vector3.down * .5f), transform.forward);

        DisplayRay(ray, 1.5f, 1.5f);
        RaycastHit[] hits             = Physics.SphereCastAll(ray, .30f, 1f);
        Item         potentialItem    = null; //where we locally store an item we could pick up
        Counter      potentialCounter = null; //storing a potentialCountertop

        foreach (RaycastHit hit in hits)
        {
            if (hit.collider == null)
            {
                continue;
            }
            if (hit.collider.tag == "Item")
            {
                if (potentialItem != null)//there's multiple items, oh no! check which one is closer and keep that as the one you interact with
                {
                    Item newPotential = hit.collider.GetComponent <Item>();
                    if (newPotential != itemHeld)//no worries about this new guy being the guy you're holding
                    {
                        float newDistance = Vector3.Distance(transform.position, newPotential.transform.position);
                        float oldDistance = Vector3.Distance(transform.position, potentialItem.transform.position);
                        if (oldDistance > newDistance)//new item is closer? its now the main one you interact with
                        {
                            potentialItem = newPotential;
                        }
                    }
                }
                else
                {
                    potentialItem = hit.collider.GetComponent <Item>();
                    if (potentialItem == itemHeld)//if the item you're looking at is the one you're holding, FORGET IT
                    {
                        potentialItem = null;
                    }
                }
            }
            if (hit.collider.tag == "Counter")
            {
                if (potentialCounter != null)//you're already looking at a counter
                {
                    Counter newPotential = hit.collider.GetComponent <Counter>();
                    float   newDistance  = Vector3.Distance(transform.position, newPotential.counterPos.position);
                    float   oldDistance  = Vector3.Distance(transform.position, potentialCounter.counterPos.transform.position);
                    if (oldDistance > newDistance)//new counter is closer, you're looking at it instead
                    {
                        potentialCounter = newPotential;
                    }
                }
                else//you're not already looking at a counter
                {
                    potentialCounter = hit.collider.transform.GetComponent <Counter>();
                }
            }
        }
        if (Input.GetButtonDown(pickUpAxis + myPlayerName))
        {
            if (itemHeld != null)                           //you're holding an item, now gonna drop it
            {
                if (potentialCounter != null)               //place item on counter
                {
                    if (potentialCounter is ServingCounter) //SERVING!!
                    {
                        if (itemHeld is Plate)
                        {
                            potentialCounter.itemHere = itemHeld;
                            itemHeld = null;
                            //add completed order sound
                        }
                        else
                        {
                            NeedsPlate();
                        }
                    }
                    else if (potentialCounter is TrashCan)//you're throwing it away!!
                    {
                        if (itemHeld.state.Equals("chopped"))
                        {
                            SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                        }

                        if (!itemHeld.state.Equals("chopped"))
                        {
                            SoundController.me.PlaySound(SoundController.me.dropitem, .6f);
                        }
                        TrashCan trashCan = (TrashCan)potentialCounter;
                        trashCan.DeleteItem(itemHeld);
                        itemHeld = null;
                    }
                    else if (potentialCounter.itemHere == null && !(potentialCounter is ReturnCounter))
                    {
                        if (itemHeld.state.Equals("chopped"))
                        {
                            SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                        }

                        if (!itemHeld.state.Equals("chopped"))
                        {
                            SoundController.me.PlaySound(SoundController.me.dropitem, .6f);
                        }
                        potentialCounter.itemHere = itemHeld;
                        itemHeld.collider.enabled = false;
                        itemHeld = null;
                    }
                    else if (potentialCounter.itemHere is Plate && !(potentialCounter is ReturnCounter))
                    {
                        Plate plate = (Plate)potentialCounter.itemHere;
                        if (!(itemHeld is Pan))
                        {
                            if (plate.Add(new ItemStats(itemHeld.name, itemHeld.state)))
                            {
                                SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                                Destroy(itemHeld.gameObject);
                            }
                        }
                        else
                        {
                            Pan pan = (Pan)itemHeld;
                            if (plate.Add(new ItemStats(pan.cooking.name, pan.cooking.state)))
                            {
                                SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                                Destroy(pan.cooking.gameObject);
                                pan.cooking = null;
                            }
                        }
                    }
                    else if (potentialCounter.itemHere is Pan && itemHeld.name.Equals("burger") && itemHeld.state.Equals("chopped"))
                    {
                        Pan pan = (Pan)potentialCounter.itemHere;
                        pan.cooking = itemHeld;
                        SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                        pan.SpawnProgBar();
                        pan.cooking.collider.enabled = false;
                        itemHeld = null;
                        if (pan.cooking != null)
                        {
                            SoundController.me.PlaySound(SoundController.me.grilling, .6f);
                        }
                    }
                }
                else if (potentialItem != null)//combine items
                {
                    //weird shit with combining
                    if (potentialItem is Plate)
                    {
                        Plate plate = (Plate)potentialItem;
                        if (plate.Add(new ItemStats(itemHeld.name, itemHeld.state)))
                        {
                            SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                            Destroy(itemHeld.gameObject);
                        }
                    }
                }
                else
                {
                    if (itemHeld.state.Equals("chopped"))
                    {
                        SoundController.me.PlaySound(SoundController.me.dropchoppeditem, .6f);
                    }

                    if (!itemHeld.state.Equals("chopped"))
                    {
                        SoundController.me.PlaySound(SoundController.me.dropitem, .6f);
                    }
                    itemHeld.rb.isKinematic   = false;
                    itemHeld.collider.enabled = true;
                    itemHeld = null;
                }
            }
            else//you're holding nothing
            {
                if (potentialCounter != null)//you're looking at a counter
                {
                    if (potentialCounter.itemHere == null && potentialCounter is Crate)
                    {
                        SoundController.me.PlaySound(SoundController.me.pickUpItem, .6f);
                        Crate crate = (Crate)potentialCounter;
                        itemHeld = crate.SpawnItem();
                        itemHeld.rb.isKinematic   = true;
                        itemHeld.collider.enabled = false;
                    }
                    else if (potentialCounter is ReturnCounter)//getting a plate from return
                    {
                        ReturnCounter rc = (ReturnCounter)potentialCounter;
                        if (rc.GetPlate())//you can grab a plate
                        {
                            SoundController.me.PlaySound(SoundController.me.pickUpItem, .6f);
                            GameObject obj = (GameObject)Instantiate(Resources.Load("Items/Plate"), holdingPos, Quaternion.identity);
                            itemHeld = obj.GetComponent <Item>();
                            itemHeld.collider.enabled = false;
                        }
                    }
                    else if (potentialCounter.itemHere != null)
                    {
                        SoundController.me.PlaySound(SoundController.me.pickUpItem, .6f);
                        itemHeld = potentialCounter.itemHere;
                        potentialCounter.itemHere   = null;
                        itemHeld.rb.isKinematic     = true;
                        itemHeld.collider.enabled   = false;
                        itemHeld.transform.position = transform.position + transform.forward;
                        itemHeld.transform.rotation = Quaternion.Euler(0, 0, 0);
                    }
                    else if (potentialItem != null)//you are looking at an item
                    {
                        SoundController.me.PlaySound(SoundController.me.pickUpItem, .6f);
                        itemHeld = potentialItem;
                        itemHeld.rb.isKinematic     = true;
                        itemHeld.collider.enabled   = false;
                        itemHeld.transform.position = transform.position + transform.forward;
                        itemHeld.transform.rotation = Quaternion.Euler(0, 0, 0);
                    }
                }
                else
                {
                    if (potentialItem != null)//you are looking at an item
                    {
                        SoundController.me.PlaySound(SoundController.me.pickUpItem, .6f);
                        itemHeld = potentialItem;
                        itemHeld.rb.isKinematic     = true;
                        itemHeld.collider.enabled   = false;
                        itemHeld.transform.position = transform.position + transform.forward;
                        itemHeld.transform.rotation = Quaternion.Euler(0, 0, 0);
                    }
                }
            }
        }
        if (Input.GetButton(interactAxis + myPlayerName))
        {
            if (itemHeld == null)             //not holding an item
            {
                if (potentialCounter != null) //looking at a counter
                {
                    if (potentialCounter is CuttingStation)
                    {
                        CuttingStation cuttingStation = (CuttingStation)potentialCounter;
                        if (cuttingStation.canBeUsed)
                        {
                            if (cuttingStation.isCutting == false)
                            {
                                SoundController.me.PlaySound(SoundController.me.chopping, .65f);
                            }
                            cuttingStation.isCutting = true;
                        }
                    }
                }
            }
        }
    }
 public void Dispose()
 {
     TrashCan.Throw(ref file);
 }
Ejemplo n.º 18
0
    // Player near a chopping table
    public void OnFoundTrashCan(TrashCan trashCan)
    {
        Debug.Log("OnFoundTrashCan");

        m_focusTrashCan = trashCan;
    }
Ejemplo n.º 19
0
 public virtual void Dispose()
 {
     TrashCan.Throw(ref chunkCursor);
 }
Ejemplo n.º 20
0
    public void OnClearTrashCan(TrashCan trashCan)
    {
        Debug.Log("OnClearTrashCan");

        m_focusTrashCan = null;
    }
 public virtual void Dispose()
 {
     TrashCan.Throw(ref client);
 }
Ejemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     tc130           = GetComponent <TrashCan>();
     slider.maxValue = tc130.maxInner;
 }
Ejemplo n.º 23
0
 public void Dispose()
 {
     TrashCan.Throw(ref reader);
 }
Ejemplo n.º 24
0
 public override void Dispose()
 {
     TrashCan.Throw(ref documentsCursor);
     base.Dispose();
 }
Ejemplo n.º 25
0
 public override void Dispose()
 {
     TrashCan.Throw(ref flushSemaphore);
     base.Dispose();
 }
Ejemplo n.º 26
0
 public async Task <Document> CreateItemAsync(TrashCan trashCan)
 {
     return(await _client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(ConfigSettings.Database, ConfigSettings.Collection), trashCan, disableAutomaticIdGeneration : true));
 }