Example #1
0
        public GamaBlockRef AddBlock(string name)
        {
            foreach (var b in Blocks)
            {
                if (b.Name == name)
                {
                    name = b.Next();
                    var block = new GamaBlockRef(name, Value.AppendBasicBlock(name));
                    b.Add(block);
                    return(block);
                }
            }
            var group = new ObjectGroup <GamaBlockRef>(name);

            name = group.Next();
            var blk = new GamaBlockRef(name, Value.AppendBasicBlock(name));

            group.Add(blk);
            Blocks.Add(group);
            return(blk);
        }
Example #2
0
 public void MoveAfter(GamaBlockRef after) => Block.MoveAfter(after.Block);
Example #3
0
 // These two methods assume that 'before' and 'after' blocks are residing in same function
 // If they are not either:
 //  - Compiler has a bug
 //  - Somebody edited the binaries (or code itself, a.k.a compiler has a bug v2: electric boogaloo)
 public void MoveBefore(GamaBlockRef before) => Block.MoveBefore(before.Block);