Ejemplo n.º 1
0
    public void SpawnBullet(Vector2 pos, Vector2 velocity, AThing owner)
    {
        var bullet = m_BulletPool.Get();

        bullet.transform.position = pos;
        bullet.Init(velocity, owner);
    }
Ejemplo n.º 2
0
    static void Main(string[] args)
    {
        Dictionary <int, AThing> dict = new Dictionary <int, AThing>();

        for (var c = 0; c < 100; c++)
        {
            DateTime nowTime = DateTime.Now;
            for (var i = 0; i < 1000000; i++)
            {
                var thing = new AThing {
                    id = (c * 1000000) + i, Name = $"Item {(c * 1000000) + i}"
                };
                dict.Add(thing.id, thing);
            }
            var timeTaken = DateTime.Now - nowTime;
            Console.WriteLine($"pass number {c} took {timeTaken.Milliseconds} milliseconds");
        }
    }
Ejemplo n.º 3
0
 public void Visit(AThing aThing)
 {
     Result = new ATransformedThing(aThing, Arg);
 }
Ejemplo n.º 4
0
 class ATransformedThing : ITransformedThing { public ATransformedThing(AThing aThing, int arg)
                                               {
                                               }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            AThing thing = MakeStuff;

            Dictionary <string, Action> actions = new Dictionary <string, Action>();

            actions.Add("1", DoThings);



            actions["1"]();



            thing(7);

            List <string> names = new List <string>();


            Queue <int> numbers = new Queue <int>();

            numbers.Enqueue(8);
            numbers.Enqueue(88);
            numbers.Enqueue(888);
            numbers.Enqueue(8888);
            numbers.Enqueue(88888);

            int h = numbers.Dequeue();


            Stack <int> alsoNumbers = new Stack <int>();

            alsoNumbers.Push(9);

            int u = alsoNumbers.Pop();

            Thing <int> y = new Thing <int>();

            Dictionary <string, string> ordbok = new Dictionary <string, string>();

            //names[3] =

            ordbok["Micke"] = "Lärare";

            //Dictionary<Dictionary<int, int>, Dictionary<string, string>> hej;

            //HashSet
            //Delegates


            Container <float> c1 = new Container <float>();

            c1.next      = new Container <float>();
            c1.next.next = new Container <float>();

            c1.next.next.next = c1;

            Container <float> current = c1;

            while (current.next != null)
            {
                Console.WriteLine(current.contents);
                current = current.next;
            }
        }
Ejemplo n.º 6
0
 public void Init(Vector2 velocity, AThing owner)
 {
     Body.velocity = velocity;
     m_Owner       = owner;
     m_Deadtime    = Time.time + m_LifeDuration;
 }
        public ActionResult ModelBindAThing(AThing thing)
        {
            ViewBag.Stuff = thing.SomeRandomValue;

            return(View());
        }