Esempio n. 1
0
 // Puts the call in the board and changes the transform appropriately
 void PlaceCall(CallScript call, Vector2 start)
 {
     call.centerBlock.transform.position = board.BoardPositionToWorldPosition(start);
     for (int i = 0; i < call.blocks.Length; i++)
     {
         Vector2 spot = start + call.points[i];
         board.CallBoard[(int)spot.x, (int)spot.y] = call.blocks[i];
         call.blocks[i].transform.position         = board.BoardPositionToWorldPosition(spot);
     }
 }
        public CallScriptItem New()
        {
            var newScript = new CallScript
            {
                DateCreate = DateTime.Now,
                DateModify = DateTime.Now,
                Name       = "Новый скрипт"
            };

            Db.CallScripts.Add(newScript);
            Db.SaveChanges();

            return(Get(newScript.Id));
        }
        private CallScript AddScript(IField <JObject> field, string script)
        {
            CallScript call;

            lock (_scripts)
            {
                if (!_scripts.TryGetValue(script, out call))
                {
                    call = new CallScript {
                        Field = field
                    };
                    _scripts[script] = call;
                }
            }
            return(call);
        }
Esempio n. 4
0
    public CallScript[] storyCalls = new CallScript[] { new ExampleScript() };  // list of story calls, IN ORDER

    public CallScript getNextCall()
    {
        //[TODO] Make it so random calls cannot be repeated
        if (sequence[current] > 0)
        {
            int r = Mathf.RoundToInt(Random.value * (randomCalls.Length - 1)); // get the number for a random call
            sequence[current]--;                                               // decrese the number of calls we need to do still
            CallScript ret = randomCalls[r];
            return(ret);                                                       // return the random call
        }
        else
        {
            current++;                      // increase our sequence thing
            return(storyCalls[storyPos++]); // Return the next story script
        }
    }
Esempio n. 5
0
        public IOrderedQueryable<Tracker.Models.Inter> Query(long cellid, string group1)
        {
            var result = SQLQuery(cellid);

            ViewData["id"] = cellid;
            string workdir = Server.MapPath("~");
            string newdir = workdir + "Home\\Manage";
            FileInfo f = new FileInfo(workdir + "\\Files\\" + cellid + ".csv");
            StreamWriter w = f.CreateText();

            var dataContext = new DB();
            string type_cellid = (from p in dataContext.Structures
                                  where p.ID == cellid
                                  select p.Label).Single();

            // create a CSV file of the results
            List<long> ids = new List<long>();

            foreach (var items in result)
            {
                /*  if (first == 1)
                  {
                      ids.Add(items.ID);
                      first = 0;
                  }

                  foreach (long values in ids)
                  {
                      if (values == items.ID)
                          exists = 1;
                      if (exists = 1)
                         ids.Add(items.ID);

                  }*/

                w.WriteLine(items.MainID + "," + items.ID + "," + items.TypeID + "," + items.ChildTypeID + "," + items.ChildStructID + "," + items.Label + "," + items.Dir+","+items.Name);
            }

            foreach (var items in result)
            {
                var midresult = SQLQuery(items.ID);
                foreach (var midresult_items in midresult)
                {
                    w.WriteLine(midresult_items.MainID + "," + midresult_items.ID + "," + midresult_items.TypeID + "," + midresult_items.ChildTypeID + "," + midresult_items.ChildStructID + "," + midresult_items.Label + "," + midresult_items.Dir+","+midresult_items.Name);
                }
            }
            w.Close();

            CallScript call = new CallScript();
            if (type_cellid != null)
                type_cellid = type_cellid.Replace(" ", "_");
            else
            {
                type_cellid = "---";
            }
            string param = cellid + "," + type_cellid + ViewData["layout"];
            call.Execute(param);

            return result;
        }