public void AppendHeader(string header, IReactPromise <JSValue.Void> promise)
 {
     InternalInterface.AppendLogHeader(header);
     promise.Resolve();
 }
Exemplo n.º 2
0
 public InternalClass(InternalInterface face)
 {
 }
Exemplo n.º 3
0
 public InternalClass(InternalInterface face)
 {
 }
Exemplo n.º 4
0
        public static void Initialize()
        {
            try
            {
                if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero)
                {
                    throw new Exception("Attempted to initialize " + typeof(GameHack).Name + " before 'game.dll' has been loaded.");
                }

                var sw = (Stopwatch)null;

                sw = new Stopwatch();
                Trace.WriteLine("Initializing addresses . . .");
                Trace.Indent();
                sw.Start();
                GameAddresses.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing functions . . .");
                Trace.Indent();
                sw.Start();
                GameFunctions.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing Game api . . .");
                Trace.Indent();
                sw.Start();
                InternalGame.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing JassMachine api . . .");
                Trace.Indent();
                sw.Start();
                InternalScript.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing Interface api . . .");
                Trace.Indent();
                sw.Start();
                InternalInterface.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing Input api . . .");
                Trace.Indent();
                sw.Start();
                InternalInput.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                sw = new Stopwatch();
                Trace.WriteLine("Initializing Natives api . . .");
                Trace.Indent();
                sw.Start();
                InternalNatives.Initialize();
                sw.Stop();
                Trace.Unindent();
                Trace.WriteLine(" - Done! (" + sw.ElapsedMilliseconds + " ms)");

                GameHack.IsReady = true;
                GameHack.OnReady();
            }
            catch (Exception exception)
            {
                MessageBox.Show(
                    "Fatal exception!" + Environment.NewLine +
                    exception + Environment.NewLine +
                    "Aborting execution!",
                    typeof(GameHack) + ".Initialize()", MessageBoxButton.OK, MessageBoxImage.Error);
                Process.GetCurrentProcess().Kill();
            }
        }
Exemplo n.º 5
0
 internal ImplementationConsumer(InterfaceImplementation impl)
 {
     _impl = impl;
 }
Exemplo n.º 6
0
        private InterfaceReporting CreateInternalInterfaceReport(InternalInterface i, string type)
        {
            //write processing output to same line
            Console.Write("Assessing interface for {0}            \r", i.TargetUnit);

            //id, entity, bucket/unit, type
            InterfaceReporting interfaceReport = new InterfaceReporting();
            interfaceReport.InterfaceId = i.Id;
            interfaceReport.TargetEntityId = i.TargetEntityId;
            interfaceReport.TargetUnit = i.TargetUnit;
            interfaceReport.Type = type;

            //determine total number of source entities
            var entity = (from e in _entities
                          where e.Id == i.TargetEntityId
                          select e).FirstOrDefault();

            interfaceReport.TotalEntitySources = GetStrength(entity, type);

            //determine total number of source buckets
            interfaceReport.TotalBucketsSources = InterfaceSources(entity, type).Count();

            //get list/array of unique units
            interfaceReport.SourceBuckets = SourcesToString(InterfaceSources(entity, type));

            return interfaceReport;
        }
Exemplo n.º 7
0
        private void BuildInternalInterfaces(ConsoleLog log)
        {
            FAASModel _context = new FAASModel();
            log.Log("Build internal bucket Interfaces - start");

            try
            {
                //get target id & unit for each relationship
                var f = (from r in _context.EntityRelationships
                         select new
                         {
                             RelationshipId = r.Id,
                             TargetEntityId = r.CalledEntityId,
                             SourceEntityId = r.CallingEntityId,
                             TargetUnit = (from t in _context.Entities
                                           where t.Id == r.CalledEntityId
                                           select new { t.NormalisedUnit }).FirstOrDefault(),
                             SourceUnit = (from t in _context.Entities
                                           where t.Id == r.CallingEntityId
                                           select new { t.NormalisedUnit }).FirstOrDefault()
                         });

                foreach (var a in f)
                {
                    if (a.SourceUnit.NormalisedUnit.Equals(a.TargetUnit.NormalisedUnit))
                    {
                        bool exists = CheckInterface(a.RelationshipId, a.TargetEntityId, a.TargetUnit.NormalisedUnit, a.SourceEntityId, a.SourceUnit.NormalisedUnit);
                        if (!exists)
                        {
                            log.Log(String.Format("Creating Interface for {0}            \r", a.TargetUnit.NormalisedUnit));
                            //create new interface
                            InternalInterface newInterface = new InternalInterface();
                            newInterface.TargetEntityId = a.TargetEntityId;
                            newInterface.TargetUnit = a.TargetUnit.NormalisedUnit.ToString();
                            newInterface.EntityRelationshipIds = a.RelationshipId.ToString();
                            _internalInterfaces.Add(newInterface);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                log.Log(String.Format("Error creating interface: {0}", e));
            }
            log.Log("Build internal bucket Interfaces - complete");
        }