Пример #1
0
 // Use this for initialization
 //  GameObject tempSound;
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     realTableStartPos = realTable.transform.position;
     tableScript       = realTable.GetComponent <TableScript>();
     startPos          = transform.position;
 }
Пример #2
0
    public void CustomerLeaves()
    {
        TableScript tableScript = GetComponent <TableScript>();

        switch (tableScript.customersAtTable)
        {
        case 1:
            StartCoroutine(FadeInFadeOutText(loseOneCustomer, word_tmpObj));
            GameManager.Instance.ReduceServerScore(10);
            break;

        case 2:
            StartCoroutine(FadeInFadeOutText(loseTwoCustomers, word_tmpObj));
            GameManager.Instance.ReduceServerScore(20);
            break;

        case 3:
            StartCoroutine(FadeInFadeOutText(loseThreeCustomers, word_tmpObj));
            GameManager.Instance.ReduceServerScore(30);
            break;

        case 4:
            StartCoroutine(FadeInFadeOutText(loseFourCustomers, word_tmpObj));
            GameManager.Instance.ReduceServerScore(40);
            break;
        }

        GameManager.Instance.DecreaseMood(5);

        Evaluation_CustomerService.Instance.UpdateNumCustomersServed(1, true);
    }
Пример #3
0
    public void CmdSeatCustomer(GameObject detectedObject, GameObject player)
    {
        // Debug.Log("NetworkedCustomerInteraction - CmdSeatCustomer");
        //  Debug.Log("NetworkedCustomerInteraction - Detected object: " + detectedObject.tag);

        //get table's table script
        TableScript tableScript = detectedObject.GetComponent <TableScript>();

        var heldCustomer = player.transform.GetChild(0).GetChild(1).GetChild(0).gameObject;


        //if table has enough seats
        if (tableScript.CheckSufficientSeats(heldCustomer.GetComponent <CustomerBehaviour_BeingHeld>().groupSizeNum))
        {
            GetQueueingCustomerPatience(detectedObject);
            RpcSeatCustomer(player, detectedObject);

            //DECREASE
            GameManager.Instance.currentNumWaitingCustomers -= 1;
        }
        else
        {
            // Debug.Log("Not enough seats");
        }
    }
Пример #4
0
    public void SuccessfulCustomerService()
    {
        TableScript tableScript = GetComponent <TableScript>();

        //TODO: Change according to how many customers there are
        switch (tableScript.customersAtTable)
        {
        case 1:
            StartCoroutine(FadeInFadeOutText(servedOneCustomer, pointsText, true));
            GameManager.Instance.AddServerScore(50);
            Evaluation_OverallPlayerPerformance.Instance.UpdateMaxCustomerServiceScore(50);

            break;

        case 2:
            StartCoroutine(FadeInFadeOutText(servedTwoCustomers, pointsText, true));
            GameManager.Instance.AddServerScore(100);
            Evaluation_OverallPlayerPerformance.Instance.UpdateMaxCustomerServiceScore(100);
            break;

        case 3:
            StartCoroutine(FadeInFadeOutText(servedThreeCustomers, pointsText, true));
            GameManager.Instance.AddServerScore(150);
            Evaluation_OverallPlayerPerformance.Instance.UpdateMaxCustomerServiceScore(150);
            break;

        case 4:
            StartCoroutine(FadeInFadeOutText(servedFourCustomers, pointsText, true));
            GameManager.Instance.AddServerScore(200);
            Evaluation_OverallPlayerPerformance.Instance.UpdateMaxCustomerServiceScore(200);
            break;
        }
    }
 void Awake()
 {
     if (TableScript.instance == null)
     {
         TableScript.instance = this;
     }
     Table = GetComponent <UISprite> ();
 }
Пример #6
0
 // Start is called before the first frame update
 void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     kitchenTable = FindObjectOfType <KitchenTableScript>();
     tableScript  = FindObjectOfType <TableScript>();
     runScript    = FindObjectOfType <RunScript>();
     source       = GetComponent <AudioSource>();
     source.clip  = throwSound;
     runScript.SetMaxRun(100f);
 }
Пример #7
0
 // Update is called once per frame
 void Update()
 {
     if (pendingOrders.Count > 0)
     {//if we have an order to give
         if (waiter.myState == Enemy.EnemyState.Idle)
         {
             TableScript dataSource = pendingOrders.Dequeue();
             waiter.flags   = dataSource.myFlags;
             waiter.myState = Enemy.EnemyState.Seeking;
         }
     }
 }
Пример #8
0
        //Loads a table from a VPT file
        public void Load(string Filename)
        {
            CF = new CompoundFile(Filename);

            IList <CFItem> Lst = CF.GetAllNamedEntries("TableName");

            foreach (CFItem Itm in Lst)
            {
                Name = ReadTextFileUnicode(Itm.Size, Itm);
            }
            Lst = CF.GetAllNamedEntries("AuthorName");
            foreach (CFItem Itm in Lst)
            {
                Author = ReadTextFileUnicode(Itm.Size, Itm);
            }
            Lst = CF.GetAllNamedEntries("TableVersion");
            foreach (CFItem Itm in Lst)
            {
                Version = ReadTextFileUnicode(Itm.Size, Itm);
            }
            Lst = CF.GetAllNamedEntries("TableDescription");
            foreach (CFItem Itm in Lst)
            {
                Description = ReadTextFileUnicode(Itm.Size, Itm);
            }
            Lst = CF.GetAllNamedEntries("Version");
            foreach (CFItem Itm in Lst)
            {
                m_VPVersion = ReadIntBinary(Itm) / 100;
            }
            Lst = CF.GetAllNamedEntries("MAC");
            foreach (CFItem Itm in Lst)
            {
                MD5Hash = GetFile(Itm);
            }

            Lst = CF.GetAllNamedEntries("GameData");
            foreach (CFItem Itm in Lst)
            {
                BIFFFile F = GetBIFF(Itm);
                F.IterateChunks(BlowChunk);
            }

            Script = GetScript();

            GetScriptDetails();

            if (ROMNameVar == "")
            {
                ROMNameVar = "\"" + ROM + "\"";
            }
        }
Пример #9
0
        public SDTableScriptController(Altaxo.Data.DataTable dataTable, TableScript tableScript)
        {
            this.m_DataTable = dataTable;

            if (null != tableScript)
            {
                this.m_TableScript = (IScriptText)tableScript.Clone();
            }
            else
            {
                this.m_TableScript = new TableScript();
            }

            SetElements(true);
        }
Пример #10
0
    //Taking customers orders
    public void CheckHandsEmpty()
    {
        //Debug.Log("NetworkedCustomerInteraction - CheckHandsEmpty");

        //check if player is looking at table
        if (!networkedPlayerInteraction.detectedObject.GetComponent <TableScript>())
        {
            //Debug.Log("NetworkedCustomerInteraction- Player is not looking at a table");
            return;
        }

        //get table script
        TableScript tableScript = networkedPlayerInteraction.detectedObject.GetComponent <TableScript>();

        CmdCheckHandsEmpty(networkedPlayerInteraction.detectedObject, networkedPlayerInteraction.IsInventoryFull());
        networkedPlayerInteraction.ChangePlayerState(PlayerState.Default);
    }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        eating     = false;
        gaveOrder  = false;
        myRenderer = gameObject.GetComponent <SpriteRenderer>();
        myTable    = gameObject.GetComponentInParent <TableScript>();
        mood.a     = 1;
        mood.r     = 1;
        phaseTimer = 0;

        //Phases the customer is at
        //0 is first seated waiting to get their order taken
        //1 is waiting for food.
        //2 Eating
        //3 Done eating, need to get check collected and food cleared.
        phase  = 0;
        Idling = false;
    }
Пример #12
0
    //---------------------BEHAVIOUR WHEN SEATED---------------------

    #region Just Seated

    //when customer has been brought to a table with enough seats, this method is called
    public void CustomerJustSeated(TableScript tableScript)
    {
        //assign the table the customer is seated at as their table
        tableSeatedAt = tableScript;


        //animate the customer sitting down and browsing menu
        CustomerAnimScript.SitDownAnim();
        CustomerAnimScript.BrowseMenuAnim();
        //Debug.Log("Animating customer sitting and browsing menu");

        if (isServer)
        {
            //RpcCustomerJustSeated();
            //generate the customer's order
            GenerateOrder();
        }
    }
Пример #13
0
        public override void Run(Altaxo.Worksheet.GUI.WorksheetController ctrl)
        {
            m_Table = ctrl.DataTable;

            IScriptText script = m_Table.TableScript;

            if (script == null)
            {
                script = new TableScript();
            }

            object[] args = new object[] { script, new Altaxo.Gui.Scripting.ScriptExecutionHandler(this.EhScriptExecution) };
            if (Current.Gui.ShowDialog(args, "WorksheetScript of " + m_Table.Name))
            {
                m_Table.TableScript = (TableScript)args[0];
            }

            this.m_Table = null;
        }
Пример #14
0
        //Loads the script from GameData
        public TableScript GetScript()
        {
            if (CF == null)
            {
                return(null);
            }

            IList <CFItem> Lst = CF.GetAllNamedEntries("GameData");

            foreach (CFItem Itm in Lst)
            {
                BIFFFile    F    = GetBIFF(Itm);
                string      Code = Encoding.ASCII.GetString(F.GetChunk("CODE"));
                TableScript TS   = new TableScript();
                TS.Script = Code;
                return(TS);
            }

            return(null);
        }
Пример #15
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="from">The data table to copy the structure from.</param>
        public DataTable(DataTable from)
            : this((DataColumnCollection)from._dataColumns.Clone(), (DataColumnCollection)from._propertyColumns.Clone())
        {
            this._parent       = null; // do not clone the parent
            this._tableName    = from._tableName;
            this._tableScript  = null == from._tableScript ? null : (TableScript)from._tableScript.Clone();
            this._creationTime = this._lastChangeTime = DateTime.UtcNow;
            this._notes        = from._notes;

            // Clone also the table properties (deep copy)
            if (from._tableProperties != null)
            {
                foreach (string key in from._tableProperties.Keys)
                {
                    ICloneable val = from._tableProperties[key] as ICloneable;
                    if (null != val)
                    {
                        this.SetTableProperty(key, val.Clone());
                    }
                }
            }
        }
Пример #16
0
    //When the player is looking at a table and is carrying a customer,
    public void SeatCustomer(List <GameObject> playerInventory, GameObject tableGameobj)
    {
        // Debug.Log("Seat customer method called");

        if (!tableGameobj.GetComponent <TableScript>())
        {
            //Debug.Log("player is not looking at table");
            return;
        }

        if (!playerInventory.Contains(customerBeingHeld))
        {
            //Debug.Log("player is not holding customer??");
            return;
        }

        TableScript tableScript = tableGameobj.GetComponent <TableScript>();

        //If the table has enough seats for the group of customers,
        if (tableScript.CheckSufficientSeats(customerBeingHeld.GetComponent <CustomerBehaviour_Queueing>().GroupSizeNum))
        {
            //Debug.Log("Enough seats for customers");

            //disallow tables from being detected
            TableColliderManager.Instance.ToggleTableDetection(false);

            //remove the customer from the inventory
            playerInventory.Remove(customerBeingHeld);

            //stop holding the customer + activate the customers at the table
            Destroy(customerBeingHeld.gameObject);

            customerBeingHeld = null;

            PlayerInteractionManager.ChangePlayerState(PlayerInteractionManager.PlayerState.Default, true);
        }
    }
Пример #17
0
    public void CheckHandsEmpty(List <GameObject> playerInventory, GameObject tableGameobj)
    {
        //check if the player is looking at a table
        if (tableGameobj.GetComponent <TableScript>() == null)
        {
            //Debug.Log("player is not looking at table");
            return;
        }

        //get the table script
        TableScript tableScript = tableGameobj.GetComponent <TableScript>();

        //if the player's hands are full, don't take their order
        if (playerInventory.Count > 0)
        {
            //Debug.Log("player's hands are full");
            tableScript.TableFeedbackScript.HandsFullFeedback();
            return;
        }

        //else, take the order of the customers at the table
        //tableScript.TakeOrder();
        PlayerInteractionManager.ChangePlayerState(PlayerInteractionManager.PlayerState.Default);
    }
Пример #18
0
        private Furniture UpgradeFurniture(Furniture furn)
        {
            Vector3    vector3    = furn.OriginalPosition;
            Quaternion rotation   = furn.transform.rotation;
            float      num        = furn.RotationOffset;
            Room       room       = furn.Parent;
            SnapPoint  snapPoint1 = furn.SnappedTo;
            Dictionary <int, Furniture> dictionary = Enumerable.ToDictionary <SnapPoint, int, Furniture>(Enumerable.Where <SnapPoint>((IEnumerable <SnapPoint>)furn.SnapPoints, (Func <SnapPoint, bool>)(sp => (UnityEngine.Object)sp.UsedBy != (UnityEngine.Object)null)), (Func <SnapPoint, int>)(sp => sp.Id), (Func <SnapPoint, Furniture>)(sp => sp.UsedBy));

            for (int index = 0; index < furn.SnapPoints.Length; ++index)
            {
                furn.SnapPoints[index].UsedBy = (Furniture)null;
            }
            TableScript component1 = furn.GetComponent <TableScript>();
            Server      component2 = furn.GetComponent <Server>();
            Actor       ownedBy    = furn.OwnedBy;

            UnityEngine.Object.Destroy((UnityEngine.Object)furn.gameObject);
            //if (SelectorController.Instance.DeleteParent(furn))
            //    UnityEngine.Object.Destroy((UnityEngine.Object)furn.SnappedTo.Parent.gameObject);
            Furniture component3 = UnityEngine.Object.Instantiate <GameObject>(furn.FurnitureUpgrade[0]).GetComponent <Furniture>();

            component3.RotationOffset = num;
            try
            {
                if ((UnityEngine.Object)snapPoint1 != (UnityEngine.Object)null)
                {
                    if (component3.IsSnapping)
                    {
                        component3.SnappedTo = snapPoint1;
                        snapPoint1.UsedBy    = component3;
                    }
                    else
                    {
                        vector3 = new Vector3(vector3.x, (float)(furn.Parent.Floor * 2), vector3.z);
                    }
                }
                component3.OriginalPosition   = vector3;
                component3.transform.position = vector3;
                component3.transform.rotation = rotation;
                component3.Parent             = room;
                Server component4 = component3.GetComponent <Server>();
                if ((UnityEngine.Object)component2 != (UnityEngine.Object)null && (UnityEngine.Object)component4 != (UnityEngine.Object)null)
                {
                    component4.WireTo(component2.Rep, true);
                    component4.PreWired = true;
                }
                component3.OwnedBy = ownedBy;
                if ((UnityEngine.Object)ownedBy != (UnityEngine.Object)null)
                {
                    ownedBy.Owns.Add(component3);
                }
                if (furn.InteractionPoints.Length == component3.InteractionPoints.Length)
                {
                    for (int index = 0; index < furn.InteractionPoints.Length; ++index)
                    {
                        if ((UnityEngine.Object)furn.InteractionPoints[index].UsedBy != (UnityEngine.Object)null && furn.InteractionPoints[index].Name.Equals(component3.InteractionPoints[index].Name))
                        {
                            Actor usedBy = furn.InteractionPoints[index].UsedBy;
                            usedBy.UsingPoint = component3.InteractionPoints[index];
                            component3.InteractionPoints[index].UsedBy = usedBy;
                        }
                    }
                }
                component3.UpdateFreeNavs(false);
            }
            catch (Exception e)
            {
                HUD.Instance.AddPopupMessage(e.Message + "\n" + e.StackTrace, "Cogs", "", 0, 1);
            }
            return(component3);
        }
    //public method to set the table the dirty dish belongs to
    public void SetTableScript(TableScript _tableScript)
    {
        tableSeatedAt = _tableScript;

        AddToTable();
    }
Пример #20
0
 public void RequestAdd(TableScript incTable)
 {
     pendingOrders.Enqueue(incTable);
     Debug.Log("added request #" + pendingOrders.Count);
 }