コード例 #1
0
        public static bool Parse(ControlFlowGraph cfg, SharedData data)
        {
            List<AALocalDecl> usedLocals = GetUsedLocals.Parse(cfg.Method.GetBlock(), data);

            List<ControlFlowGraph.Node> modifications = new List<ControlFlowGraph.Node>();
            foreach (ControlFlowGraph.Node node in cfg.Nodes)
            {
                if (node.Statement is ALocalDeclStm)
                {
                    AALocalDecl decl = (AALocalDecl) ((ALocalDeclStm) node.Statement).GetLocalDecl();
                    if (!usedLocals.Contains(decl))
                    {
                        modifications.Add(node);
                    }
                }
                else
                {
                    break;
                }
            }
            foreach (ControlFlowGraph.Node node in modifications)
            {
                cfg.Remove(node);
                node.Statement.Parent().RemoveChild(node.Statement);
            }
            return modifications.Count > 0;
        }
コード例 #2
0
 public CloneMethod(SharedData data, Dictionary<AALocalDecl, PLvalue> localMap, Node currentCloneNode, ExtraCheckDelegate extraCheck = null)
 {
     this.data = data;
     this.localMap = localMap;
     this.currentCloneNode = currentCloneNode;
     this.extraCheck = extraCheck;
 }
コード例 #3
0
ファイル: FMain.cs プロジェクト: danbystrom/VisionQuest
        public FMain(SharedData data)
        {
            InitializeComponent();

            var wa = SystemInformation.WorkingArea;
            wa.Inflate(-wa.Width / 20, -wa.Height / 20);
            Bounds = wa;

            _data = data;
            _data.Size = new Size(ClientSize.Width - pnRenderControlPanel.Left, ClientSize.Height - pnRenderControlPanel.Top);
            _data.Size = new Size(_data.Size.Width/2, _data.Size.Height/2);
            _data.Storage = Storage.Load();

            // create the RenderControl
            _renderControl = new RenderControl
            {
                Dock = DockStyle.Fill,
                Size = data.Size,
                Location = Point.Empty
            };

            pnRenderControlPanel.Size = data.Size;
            pnRenderControlPanel.Controls.Add(_renderControl);

            optAllLines.CheckedChanged += (sender, args) => uiChanged();
            optNoLines.CheckedChanged += (sender, args) => uiChanged();

            numSurfaceSize.Value = _data.WaterSurfaceSize;
            numSurfaceScale.Value = _data.WaterSurfaceScale;

            foreach (var ctrl in Controls.OfType<Control>())
                ctrl.Visible = false;
        }
コード例 #4
0
        public static void CalculateLiveVariables(ControlFlowGraph cfg, SharedData data)
        {
            //First, generate lists of what is used in each node
            Dictionary<ControlFlowGraph.Node, List<AALocalDecl>> usedVars = new Dictionary<ControlFlowGraph.Node, List<AALocalDecl>>();
            foreach (ControlFlowGraph.Node node in cfg.Nodes)
            {
                node.LiveVariables.Clear();

                PExp exp = node.Expression;
                if (exp == null)
                    usedVars[node] = new List<AALocalDecl>();
                else
                {
                    GetUsedVariables variableFinder = new GetUsedVariables(data);
                    exp.Apply(variableFinder);
                    usedVars[node] = variableFinder.UsedLocals;
                }
            }

            bool changed = true;
            while (changed)
            {
                changed = false;
                foreach (ControlFlowGraph.Node node in cfg.Nodes)
                {

                    int count = node.LiveVariables.Count;
                    Join(node);
                    node.LiveVariables.Subtract(GetAssignedTo(node, data));
                    node.LiveVariables.Union(usedVars[node]);
                    changed |= count != node.LiveVariables.Count;
                }
            }
        }
コード例 #5
0
ファイル: FormLoader.cs プロジェクト: unforbidable/patcher
        public FormLoader(Plugin plugin, RecordReader stockReader, bool lazyLoading, int backgroundJobs)
        {
            if (backgroundJobs < 0)
                throw new ArgumentException("Number of bakcground jobs must be a positive integer or zero");

            sharedData = new SharedData()
            {
                Plugin = plugin,
                StockReader = stockReader,
                LazyLoading = lazyLoading,
                FormsToLoad = new BlockingCollection<Form>(new ConcurrentQueue<Form>(), 1024),
                WorkerCompleteEvent = new AutoResetEvent(false)
            };

            this.stockReader = stockReader;
            asyncLoading = backgroundJobs > 0;

            bool useStockReader = true;
            while (backgroundJobs-- > 0)
            {
                Worker worker = new Worker(sharedData, useStockReader);
                worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
                worker.RunWorkerAsync();
                workers.Add(new WorkerInfo()
                {
                    Worker = worker
                });

                // Only the first worker can use the stock reader
                useStockReader = false;
            }
        }
コード例 #6
0
ファイル: SnapInBase.cs プロジェクト: SiteView/ECC8.13
 internal void AddSharedData(SharedData sharedData)
 {
     this._externalDataObjects.Add(sharedData.DataObjectId, sharedData);
     ChangeNotificationSubscriptionCommand command = new ChangeNotificationSubscriptionCommand();
     command.DataObjectId = sharedData.DataObjectId;
     command.IsActive = true;
     this.SnapInClient.SnapInPlatform.ProcessCommand(command);
 }
コード例 #7
0
ファイル: PrimitiveQuad.cs プロジェクト: Powerino73/paradox
 /// <summary>
 /// Initializes a new instance of the <see cref="PrimitiveQuad" /> class with a particular effect.
 /// </summary>
 /// <param name="graphicsDevice">The graphics device.</param>
 /// <param name="effect">The effect.</param>
 public PrimitiveQuad(GraphicsDevice graphicsDevice, Effect effect)
 {
     GraphicsDevice = graphicsDevice;
     simpleEffect = effect;
     parameters = new ParameterCollection();
     parameters.Set(SpriteBaseKeys.MatrixTransform, Matrix.Identity);
     parameterCollectionGroup = new EffectParameterCollectionGroup(graphicsDevice, simpleEffect, new[] { parameters });
     sharedData = GraphicsDevice.GetOrCreateSharedData(GraphicsDeviceSharedDataType.PerDevice, "PrimitiveQuad::VertexBuffer", d => new SharedData(GraphicsDevice, simpleEffect.InputSignature));
 }
コード例 #8
0
ファイル: Dungeon.cs プロジェクト: nendmen/KMRogue
 public Dungeon(DungeonData data, SharedData sdata)
     : base(sdata)
 {
     characters = data.characters;
     target = data.target;
     field = data.field;
     message = data.message;
     items = data.items;
 }
コード例 #9
0
ファイル: SharedData.cs プロジェクト: 21garam/SW_Maestro
	void Awake()
	{
		instance = this;
		/*
		bodyId = 0;
		eyesId = 1;
		mouthId = 0;
		finId = 1;*/
	}
コード例 #10
0
ファイル: PrimitiveQuad.cs プロジェクト: Nezz/SharpDX
        /// <summary>
        /// Initializes a new instance of the <see cref="PrimitiveQuad" /> class.
        /// </summary>
        /// <param name="graphicsDevice">The graphics device.</param>
        public PrimitiveQuad(GraphicsDevice graphicsDevice)
        {
            GraphicsDevice = graphicsDevice;
            quadEffect = ToDispose(new Effect(GraphicsDevice, effectBytecode));
            quadPass = quadEffect.CurrentTechnique.Passes[0];
            matrixParameter = quadEffect.Parameters["MatrixTransform"];
            Transform = Matrix.Identity;

            sharedData = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerDevice, "Toolkit::PrimitiveQuad::VertexBuffer", () => new SharedData(GraphicsDevice));
        }
コード例 #11
0
 public static void Parse(AAProgram ast, ErrorCollection errors, SharedData data, out string rootFile)
 {
     FinalTransformations finalTrans = new FinalTransformations(errors, data);
     finalTrans.Apply(ast);
     AASourceFile rootSrcFile = Util.GetAncestor<AASourceFile>(finalTrans.mainEntry);
     if (rootSrcFile == null)
         rootFile = "";
     else
         rootFile = rootSrcFile.GetName().Text + ".galaxy";
 }
コード例 #12
0
 public void Excecute(SharedData data)
 {
     if (data.Archipelag != null)
         data.Archipelag.Kill(data.Water, data.Shadow);
     data.Archipelag = new Archipelag(
         data.VContent,
         _vProgram,
         data.Water,
         data.Shadow);
 }
コード例 #13
0
	    protected PerformanceCounterAttribute(
			string categoryName, string counterName, PerformanceCounterType counterType, PerformanceCounterType? baseCounterType)
	    {
		    this.CategoryName = categoryName;
		    this.CounterName = counterName;
		    this.BaseCounterName = counterName + "Base";
		    this.CounterType = counterType;
		    this.BaseCounterType = baseCounterType;
			this.CategoryType=PerformanceCounterCategoryType.MultiInstance;
		    this.sharedDataRef = sharedData;
	    }
コード例 #14
0
 public void Excecute(SharedData data)
 {
     var visionClass = data.Archipelag.CodeIslands.SelectMany(_ => _.Classes).Single(_ => _.Value.VClass == _vclass).Value;
     var pos = visionClass.Position + visionClass.CodeIsland.World.TranslationVector;
     pos.Y += 5;  // place the camera a bit above
     var directionToCurrentPosition = pos - data.Camera.Position;
     directionToCurrentPosition.Y = 0;
     directionToCurrentPosition.Normalize();
     directionToCurrentPosition.Y = -0.3f;
     data.Actions.Add(new MoveCameraToPositionAction(data.Camera, pos - directionToCurrentPosition*30, pos));
 }
コード例 #15
0
        protected override bool OnPaste(SharedData data, DragAndDropVerb pasteType, SyncStatus status)
        {
            //data.Add(new SharedDataItem(DataFormats.UnicodeText));
            //data.Add(new SharedDataItem(DataFormats.Text));
            //data.Add(new SharedDataItem(DataFormats.Html));

            ////string displayName1 = Encoding.Unicode.GetString(data.GetItem(DataFormats.UnicodeText).GetData());
            ////string displayName2 = Encoding.ASCII.GetString(data.GetItem(DataFormats.Text).GetData());
            //string displayName3 = Encoding.ASCII.GetString(data.GetItem(DataFormats.Html).GetData());

            return base.OnPaste(data, pasteType, status);
        }
コード例 #16
0
 public static bool Parse(ControlFlowGraph cfg, SharedData data, out bool redoLivenessAnalysis)
 {
     bool changed = false;
     redoLivenessAnalysis = false;
     Dictionary<ControlFlowGraph.Node, List<ASimpleInvokeExp>> Modifications = new Dictionary<ControlFlowGraph.Node, List<ASimpleInvokeExp>>();
     foreach (ControlFlowGraph.Node node in cfg.Nodes)
     {
         if (node.Expression is AAssignmentExp)
         {
             AAssignmentExp exp = (AAssignmentExp) node.Expression;
             if (exp.GetLvalue() is ALocalLvalue)
             {
                 AALocalDecl decl = data.LocalLinks[(ALocalLvalue) exp.GetLvalue()];
                 //If the variable is not live at any successors, remove this assignment
                 bool inUse = false;
                 foreach (ControlFlowGraph.Node successor in node.Successors)
                 {
                     if (successor.LiveVariables.Contains(decl))
                     {
                         inUse = true;
                         break;
                     }
                 }
                 if (!inUse)
                 {
                     //Move method invokes out
                     GetMethodInvokes getter = new GetMethodInvokes();
                     exp.GetExp().Apply(getter);
                     //Might also have to redo because we removed a reference to a variable in the right side
                     //if (getter.Invokes.Count > 0)
                         redoLivenessAnalysis = true;
                     Modifications[node] = getter.Invokes;
                     changed = true;
                 }
             }
         }
     }
     foreach (KeyValuePair<ControlFlowGraph.Node, List<ASimpleInvokeExp>> pair in Modifications)
     {
         ControlFlowGraph.Node node = pair.Key;
         foreach (ASimpleInvokeExp invoke in pair.Value)
         {
             AExpStm stm = new AExpStm(new TSemicolon(";"), invoke);
             AABlock pBlock = (AABlock) node.Statement.Parent();
             pBlock.GetStatements().Insert(pBlock.GetStatements().IndexOf(node.Statement), stm);
             cfg.Insert(node, stm);
         }
         cfg.Remove(node);
         node.Statement.Parent().RemoveChild(node.Statement);
     }
     return changed;
 }
コード例 #17
0
 private static List<AALocalDecl> GetAssignedTo(ControlFlowGraph.Node node, SharedData data)
 {
     if (node.Statement is ALocalDeclStm)
         return new List<AALocalDecl>(){(AALocalDecl) ((ALocalDeclStm)node.Statement).GetLocalDecl()};
     PExp exp = node.Expression;
     if (exp != null && exp is AAssignmentExp)
     {
         AAssignmentExp aExp = (AAssignmentExp) exp;
         if (aExp.GetLvalue() is ALocalLvalue)
             return new List<AALocalDecl>(){data.LocalLinks[(ALocalLvalue) aExp.GetLvalue()]};
     }
     return new List<AALocalDecl>();
 }
コード例 #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PrimitiveQuad" /> class.
        /// </summary>
        /// <param name="graphicsDevice">The graphics device.</param>
        /// <param name="effect">The effect.</param>
        public PrimitiveQuad(GraphicsDevice graphicsDevice)
        {
            GraphicsDevice = graphicsDevice;
            sharedData = GraphicsDevice.GetOrCreateSharedData(GraphicsDeviceSharedDataType.PerDevice, "PrimitiveQuad::VertexBuffer", d => new SharedData(GraphicsDevice));

            simpleEffect = new EffectInstance(new Effect(GraphicsDevice, SpriteEffect.Bytecode));
            simpleEffect.Parameters.Set(SpriteBaseKeys.MatrixTransform, Matrix.Identity);
            simpleEffect.UpdateEffect(graphicsDevice);

            pipelineState = new MutablePipelineState(GraphicsDevice);
            pipelineState.State.SetDefaults();
            pipelineState.State.InputElements = VertexDeclaration.CreateInputElements();
            pipelineState.State.PrimitiveType = PrimitiveType;
        }
コード例 #19
0
        public bool Do(SharedData data, GameTime gameTime)
        {
            var dt = (float) gameTime.ElapsedGameTime.TotalSeconds;
            _time += dt;
            var posFactor = MathUtil.SmootherStep(_time/5);
            var pos = getPointOnPath(posFactor);

            var newYaw = MathUtil.Lerp(_fromYaw, _toYaw, Math.Min(1, MathUtil.SmootherStep(_time/3)));
            var desiredPitch = -(float)Math.Asin((_toPosition.Y - _toLookAt.Y) / Vector3.Distance(_toPosition, _toLookAt));

            var newPitch = MathUtil.Lerp(data.Camera.Pitch, desiredPitch, dt);
            var rotation = Matrix.RotationYawPitchRoll(newYaw, newPitch, 0);
            data.Camera.Update(
                pos,
                pos + Vector3.TransformCoordinate(Vector3.ForwardRH * 10, rotation));
            return posFactor < 1;
        }
コード例 #20
0
ファイル: ShamirSS.cs プロジェクト: mertcetin/P2P-Backup
    public long ReconstructData(SharedData[] shares)
    {
        BigInteger[] nominators = new BigInteger[numNecessaryParts];

        for (int i = 0; i < numNecessaryParts; i++)
        {
            nominators[i] = 1;

            for (int j = 0; j < numNecessaryParts; j++)
            {
                if (i != j)
                {
                    BigInteger inv = new BigInteger(shares[i].xi) - new BigInteger(shares[j].xi);
                    inv = inv % modP;
                    if (inv < 0)
                    {
                        while (inv <= 0)
                            inv += modP;
                        inv = inv.modInverse(modP);
                    }
                    else if (inv != 1)
                    {
                        inv = inv.modInverse(modP);
                    }

                    nominators[i] = (nominators[i] * (new BigInteger(shares[j].xi) * inv)) % modP;
                }
            }

        }

        for (int i = 0; i < numNecessaryParts; i++)
        {
            nominators[i] = (nominators[i] * new BigInteger(shares[i].yi)) % modP;
        }

        BigInteger nominator = new BigInteger(0);

        for (int i = 0; i < numNecessaryParts; i++)
        {
            nominator = (nominator + nominators[i]) % modP;
        }

        return nominator.LongValue();
    }
コード例 #21
0
ファイル: PrimitiveQuad.cs プロジェクト: rbwhitaker/SharpDX
        /// <summary>
        /// Initializes a new instance of the <see cref="PrimitiveQuad" /> class.
        /// </summary>
        /// <param name="graphicsDevice">The graphics device.</param>
        public PrimitiveQuad(GraphicsDevice graphicsDevice)
        {
            GraphicsDevice = graphicsDevice;
            quadEffect = ToDispose(new Effect(GraphicsDevice, effectBytecode));
            quadPass = quadEffect.CurrentTechnique.Passes[0];
            matrixParameter = quadEffect.Parameters["MatrixTransform"];

            textureCopyPass = quadEffect.CurrentTechnique.Passes[1];
            textureParameter = quadEffect.Parameters["Texture"];
            textureSamplerParameter = quadEffect.Parameters["TextureSampler"];

            // Default LinearClamp
            textureSamplerParameter.SetResource(GraphicsDevice.SamplerStates.LinearClamp);

            Transform = Matrix.Identity;

            sharedData = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerDevice, "Toolkit::PrimitiveQuad::VertexBuffer", () => new SharedData(GraphicsDevice));
        }
コード例 #22
0
        public static void Generate(SharedData data, DirectoryInfo dir)
        {
            //Remove dublicates
            for (int i = 0; i < data.BankPreloads.Count; i++)
            {
                for (int j = i + 1; j < data.BankPreloads.Count; j++)
                {
                    if (data.BankPreloads[i].Key == data.BankPreloads[j].Key &&
                        data.BankPreloads[i].Value == data.BankPreloads[j].Value)
                    {
                        data.BankPreloads.RemoveAt(j);
                        j = i;
                        continue;
                    }
                }
            }

            StringBuilder xml = new StringBuilder();
            xml.AppendLine("<?xml version=\"1.0\" encoding=\"us-ascii\"?>");
            xml.AppendLine("<BankList>");
            foreach (KeyValuePair<string, int> pair in data.BankPreloads)
            {
                xml.AppendLine("    <Bank Name=" + pair.Key + " Player=\"" + pair.Value + "\"/>");
            }
            xml.AppendLine("</BankList>");

            string s = xml.ToString();
            byte[] bytes = new byte[s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                bytes[i] = (byte) s[i];
            }

            FileInfo file = new FileInfo(dir.FullName + "\\" + "BankList.xml");
            FileStream stream = file.Open(FileMode.Create);
            stream.Write(bytes, 0, bytes.Length);
            stream.Close();
        }
コード例 #23
0
 public MethodGetUsedVariables(SharedData data)
 {
     this.data = data;
 }
コード例 #24
0
 public CommandsModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.NotQuiteBlack;
 }
コード例 #25
0
 public FixGenerics(ErrorCollection errors, SharedData data)
 {
     this.errors = errors;
     this.data = data;
 }
コード例 #26
0
 public FixGenericLinks(Node currentClone, List<PType> types, SharedData data)
 {
     this.currentClone = currentClone;
     this.types = types;
     this.data = data;
 }
コード例 #27
0
        public bool SaveProjectFile(out string errorMessage)
        {
            errorMessage        = "";
            WritingToUserFolder = true;
            //try
            //{
            if (string.IsNullOrEmpty(CurrentProject.ProjectFile) ||
                !Directory.Exists(Path.GetDirectoryName(CurrentProject.ProjectFile)))
            {
                throw new InvalidOperationException("Project Filename hasn't been set or the directory doesn't exist.");
                //toolStripMenuItemFileSaveAs_Click(null, null);
            }

            string tempFolder = PathHelper.GetUniqueTempDir("ArchAngel");

            if (Directory.Exists(tempFolder))
            {
                Utility.DeleteDirectoryBrute(tempFolder);
            }
            if (ArchAngel.Interfaces.SharedData.CurrentProject.TemplateProject == null)
            {
                ArchAngel.Interfaces.SharedData.CurrentProject.TemplateProject = ArchAngel.Common.UserTemplateHelper.GetDefaultTemplate();
            }

            CurrentProject.ProjectSettings.UserTemplateName = CurrentProject.TemplateProject.Name;
            string versionFile = Path.Combine(tempFolder, "version.txt");

            Directory.CreateDirectory(tempFolder);
            ExtraSaveSteps(tempFolder);
            File.WriteAllText(versionFile, FileVersionLatest.ToString());
            CurrentProject.SaveAppConfig(tempFolder);
            var providerFolders = SaveProviders(tempFolder);


            //string zipFile = Path.Combine(Path.GetDirectoryName(CurrentProject.ProjectFile), Path.GetFileNameWithoutExtension(CurrentProject.ProjectFile) + ".aaproj");
            //try
            //{
            //    //Slyce.Common.Utility.DeleteFileBrute(zipFile);
            //    Utility.ZipFile(tempFolder, zipFile);
            //}
            //catch (Exception)
            //{
            //    if (File.Exists(zipFile) && (File.GetAttributes(zipFile) & FileAttributes.ReadOnly) != 0)
            //    {
            //        // We don't need to show a message to the user here, because ZipFile() already does that.
            //        //MessageBox.Show("Cannot save because project file is readonly: " + zipFile, "Cannot Save - ReadOnly", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //        return false;
            //    }

            //    throw;
            //}

            // Delete the temp folder
            //Slyce.Common.Utility.DeleteDirectoryBrute(tempFolder);

            // ## New Project Save Method ## //

            string outputDirectory = Path.Combine(Path.GetDirectoryName(CurrentProject.ProjectFile), ProviderHelper.GetProjectFilesDirectoryName(CurrentProject.ProjectFile));

            for (int i = 0; i < 3; i++)
            {
                try
                {
                    Utility.CopyDirectory(tempFolder, outputDirectory, true);
                }
                catch (Exception ex)
                {
                    if (i == 2)
                    {
                        errorMessage = "Save failed: " + ex.Message;
                        return(false);
                    }
                    else
                    {
                        System.Threading.Thread.Sleep(100);
                    }
                }
            }
            string newFilename = Path.ChangeExtension(CurrentProject.ProjectFile, ".wbproj");

            string projectFileText = CreateProjectDescriptorFile(newFilename, providerFolders);

            File.WriteAllText(newFilename, projectFileText);

            CurrentProject.ProjectFile = newFilename;
            OnSaveSuccess();

            // ## New Project Save Method ## //

            SharedData.RegistryUpdateValue("DefaultConfig", CurrentProject.ProjectFile);
            IsDirty = false;
            RaiseSaveEvent();
            // To show user something has happened
            //System.Threading.Thread.Sleep(500);
            return(true);
            //}
            //catch (Exception ex)
            //{
            //    ErrorReportingService.ReportUnhandledException(ex);
            //    return false;
            //}
        }
コード例 #28
0
 public ReactionsPollModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Orange;
 }
コード例 #29
0
 public NewConstructorFixup(AConstructorDecl constructor, AStructDecl str, SharedData data)
 {
     this.constructor = constructor;
     this.str         = str;
     this.data        = data;
 }
コード例 #30
0
 public PlayModule(YtService yt, SharedData shared, DatabaseContextBuilder db)
     : base(yt, shared, db)
 {
     this.ModuleColor = DiscordColor.Grayple;
 }
コード例 #31
0
 public WarModule(SharedData shared, DBService db)
     : base(shared, db)
 {
 }
コード例 #32
0
 /// <summary>
 /// ctor.
 /// </summary>
 /// <param name="sharedData">holds shared info between rendering classes.</param>
 public ExporterManager(SharedData sharedData)
 {
     _sharedData = sharedData;
 }
コード例 #33
0
 public BuyModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Yellow;
 }
コード例 #34
0
 public LoggingModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.DarkRed;
 }
コード例 #35
0
 public StatusModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.NotQuiteBlack;
 }
コード例 #36
0
 public UserInteraction(SharedData data, Random random, HttpClient http, Api.Imgur.Client client) : base(data, random, http, client)
 {
 }
コード例 #37
0
 public static void Parse(AStructDecl str, AStructDecl clone, List<PType> types, SharedData data)
 {
     FixGenericLinks fixer = new FixGenericLinks(clone, types, data)
         {original = str, clone = clone};
     str.Apply(fixer);
 }
コード例 #38
0
 public InstantLeaveModule(AntiInstantLeaveService service, SharedData shared, DatabaseContextBuilder db)
     : base(service, shared, db)
 {
     this.ModuleColor = DiscordColor.IndianRed;
 }
コード例 #39
0
 public GambleModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.DarkGreen;
 }
コード例 #40
0
ファイル: Fenia.cs プロジェクト: romanzes637/obj2unity
 void Reset()
 {
     sharedData = gameObject.AddComponent <SharedData> ();
     gameObject.AddComponent <GameTime> ();
     relativeField = gameObject.AddComponent <RelativeField> ();
 }
コード例 #41
0
 public SetArrayIndexes(SharedData data, ErrorCollection errors)
 {
     this.data = data;
     this.errors = errors;
 }
コード例 #42
0
ファイル: Opening.cs プロジェクト: nendmen/KMRogue
 public Opening(SharedData sdata)
     : base(sdata)
 {
     selectbox = new UI.SelectBox(0, 20, 200, new string[]{"New Game", "Load Game", "Back to the Logo", "The End"});
 }
コード例 #43
0
 public Condition1(SharedData data) : base(data)
 {
 }
コード例 #44
0
 public BlackjackModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.SapGreen;
 }
コード例 #45
0
 public BlockedUsersModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.NotQuiteBlack;
 }
コード例 #46
0
        static ConfigRunestones()
        {
            Dictionary <int, int> dictionary = new Dictionary <int, int>();

            dictionary.Add(0, 0);
            dictionary.Add(1, 3);
            dictionary.Add(2, 7);
            dictionary.Add(3, 20);
            RUNESTONE_UPDATE_V3_RARITY_TO_V4_GEM_REWARD = dictionary;
            SharedData[] dataArray1 = new SharedData[0x18];
            SharedData   data       = new SharedData();

            data.UnlockRank = 3;
            data.Id         = "Runestone001";
            data.Rarity     = 1;
            SpriteAtlasEntry entry = new SpriteAtlasEntry();

            entry.AtlasId  = "Menu";
            entry.SpriteId = "icon_rune_whirlwind_1";
            data.Sprite    = entry;
            PerkInstance instance = new PerkInstance();

            instance.Type      = PerkType.SkillUpgradeWhirlwind2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Whirlwind;
            dataArray1[0]      = data;
            data               = new SharedData();
            data.UnlockRank    = 4;
            data.Id            = "Runestone003";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_whirlwind_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeWhirlwind3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Whirlwind;
            dataArray1[1]      = data;
            data               = new SharedData();
            data.UnlockRank    = 14;
            data.Id            = "Runestone002";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_whirlwind_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeWhirlwind1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Whirlwind;
            dataArray1[2]      = data;
            data               = new SharedData();
            data.UnlockRank    = 0x18;
            data.Id            = "Runestone019";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_whirlwind_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeWhirlwind4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Whirlwind;
            dataArray1[3]      = data;
            data               = new SharedData();
            data.UnlockRank    = 5;
            data.Id            = "Runestone004";
            data.Rarity        = 1;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_leap_1";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeLeap1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Leap;
            dataArray1[4]      = data;
            data               = new SharedData();
            data.UnlockRank    = 6;
            data.Id            = "Runestone005";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_leap_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeLeap2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Leap;
            dataArray1[5]      = data;
            data               = new SharedData();
            data.UnlockRank    = 0x16;
            data.Id            = "Runestone006";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_leap_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeLeap3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Leap;
            dataArray1[6]      = data;
            data               = new SharedData();
            data.UnlockRank    = 0x21;
            data.Id            = "Runestone020";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_leap_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeLeap4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Leap;
            dataArray1[7]      = data;
            data               = new SharedData();
            data.UnlockRank    = 8;
            data.Id            = "Runestone008";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_clone_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeClone2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Clone;
            dataArray1[8]      = data;
            data               = new SharedData();
            data.UnlockRank    = 0x10;
            data.Id            = "Runestone007";
            data.Rarity        = 1;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_clone_1";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeClone1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Clone;
            dataArray1[9]      = data;
            data               = new SharedData();
            data.UnlockRank    = 0x1f;
            data.Id            = "Runestone009";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_clone_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeClone3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Clone;
            dataArray1[10]     = data;
            data               = new SharedData();
            data.UnlockRank    = 0x29;
            data.Id            = "Runestone021";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_clone_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeClone4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Clone;
            dataArray1[11]     = data;
            data               = new SharedData();
            data.UnlockRank    = 11;
            data.Id            = "Runestone010";
            data.Rarity        = 1;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_slam_1";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeSlam1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Slam;
            dataArray1[12]     = data;
            data               = new SharedData();
            data.UnlockRank    = 12;
            data.Id            = "Runestone022";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_slam_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeSlam4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Slam;
            dataArray1[13]     = data;
            data               = new SharedData();
            data.UnlockRank    = 0x19;
            data.Id            = "Runestone011";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_slam_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeSlam2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Slam;
            dataArray1[14]     = data;
            data               = new SharedData();
            data.UnlockRank    = 0x23;
            data.Id            = "Runestone012";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_slam_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeSlam3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Slam;
            dataArray1[15]     = data;
            data               = new SharedData();
            data.UnlockRank    = 0x13;
            data.Id            = "Runestone013";
            data.Rarity        = 1;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_omnislash_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeOmnislash3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Omnislash;
            dataArray1[0x10]   = data;
            data               = new SharedData();
            data.UnlockRank    = 20;
            data.Id            = "Runestone014";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_omnislash_1";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeOmnislash1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Omnislash;
            dataArray1[0x11]   = data;
            data               = new SharedData();
            data.UnlockRank    = 0x26;
            data.Id            = "Runestone015";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_omnislash_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeOmnislash2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Omnislash;
            dataArray1[0x12]   = data;
            data               = new SharedData();
            data.UnlockRank    = 0x2f;
            data.Id            = "Runestone023";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_omnislash_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeOmnislash4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Omnislash;
            dataArray1[0x13]   = data;
            data               = new SharedData();
            data.UnlockRank    = 0x1c;
            data.Id            = "Runestone016";
            data.Rarity        = 1;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_implosion_1";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeImplosion2;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion2);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Implosion;
            dataArray1[20]     = data;
            data               = new SharedData();
            data.UnlockRank    = 0x1d;
            data.Id            = "Runestone017";
            data.Rarity        = 2;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_implosion_2";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeImplosion1;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion1);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Implosion;
            dataArray1[0x15]   = data;
            data               = new SharedData();
            data.UnlockRank    = 0x2c;
            data.Id            = "Runestone018";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_implosion_3";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeImplosion4;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion4);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Implosion;
            dataArray1[0x16]   = data;
            data               = new SharedData();
            data.UnlockRank    = 50;
            data.Id            = "Runestone024";
            data.Rarity        = 3;
            entry              = new SpriteAtlasEntry();
            entry.AtlasId      = "Menu";
            entry.SpriteId     = "icon_rune_implosion_4";
            data.Sprite        = entry;
            instance           = new PerkInstance();
            instance.Type      = PerkType.SkillUpgradeImplosion3;
            instance.Modifier  = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion3);
            data.PerkInstance  = instance;
            data.LinkedToSkill = SkillType.Implosion;
            dataArray1[0x17]   = data;
            RUNESTONES         = dataArray1;
            Dictionary <SkillType, SpriteAtlasEntry> dictionary2 = new Dictionary <SkillType, SpriteAtlasEntry>(new SkillTypeBoxAvoidanceComparer());

            dictionary2.Add(SkillType.Whirlwind, new SpriteAtlasEntry("Menu", "icon_rune_whirlwind_0"));
            dictionary2.Add(SkillType.Leap, new SpriteAtlasEntry("Menu", "icon_rune_leap_0"));
            dictionary2.Add(SkillType.Clone, new SpriteAtlasEntry("Menu", "icon_rune_clone_0"));
            dictionary2.Add(SkillType.Slam, new SpriteAtlasEntry("Menu", "icon_rune_slam_0"));
            dictionary2.Add(SkillType.Omnislash, new SpriteAtlasEntry("Menu", "icon_rune_omnislash_0"));
            dictionary2.Add(SkillType.Implosion, new SpriteAtlasEntry("Menu", "icon_rune_implosion_0"));
            BASIC_RUNESTONE_SPRITES = dictionary2;
            sm_tempList             = new List <SharedData>(0x20);
            sm_unlockRankComparer   = new SharedData.UnlockRankComparer();
        }
コード例 #47
0
 public Spoiler(SharedData data, Random random, HttpClient http, Api.Imgur.Client client) : base(data, random, http, client)
 {
 }
コード例 #48
0
 public UserModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Sienna;
 }
コード例 #49
0
 public UrbanDictModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.CornflowerBlue;
 }
コード例 #50
0
 /// <summary>
 /// Initializes a new instance of the FrontEndBase class
 /// </summary>
 /// <param name="listenUri">indicate the listen uri</param>
 /// <param name="observer">indicating the broker observer</param>
 /// <param name="clientManager">indicating the client manager</param>
 /// <param name="brokerAuth">indicating the broker authorization</param>
 /// <param name="sharedData">indicating the shared data</param>
 public FrontEndBase(string listenUri, BrokerObserver observer, BrokerClientManager clientManager, BrokerAuthorization brokerAuth, SharedData sharedData)
 {
     this.replySentCallback           = new BasicCallbackReferencedThreadHelper <IAsyncResult>(this.ReplySent, this).CallbackRoot;
     this.tryToReceiveRequestCallback = new BasicCallbackReferencedThreadHelper <object>(this.TryToReceiveRequestCallback, this).CallbackRoot;
     this.listenUri              = listenUri;
     this.throttlingWaitHandle   = new ManualResetEvent(false);
     this.callbackStateQueue     = new Queue <ChannelClientState>();
     this.callbackStateQueueLock = new object();
     this.observer      = observer;
     this.clientManager = clientManager;
     this.brokerAuth    = brokerAuth;
     this.sharedData    = sharedData;
     this.observer.OnStartThrottling += this.StartThrottling;
     this.observer.OnStopThrottling  += this.StopThrottling;
 }
コード例 #51
0
 public Star(DatabaseContextBuilder db, SharedData shared, InteractivityExtension interactive)
 {
     this.Shared        = shared;
     this.Interactivity = interactive;
     this.Database      = db;
 }
コード例 #52
0
 public GambleModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.DarkGreen;
 }
コード例 #53
0
 public NumberRaceModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Teal;
 }
コード例 #54
0
 public OthelloModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Teal;
 }
コード例 #55
0
 public Owner(SharedData shared, DatabaseContextBuilder db)
 {
     this.Shared   = shared;
     this.Database = db;
 }
コード例 #56
0
 public EmojiModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.Orange;
 }
コード例 #57
0
 public MethodAnalyzer(AMethodDecl method, Dictionary<AMethodDecl, SafeVariablesData> methods, SharedData data)
 {
     this.method = method;
     this.data = data;
     this.methods = methods;
 }
コード例 #58
0
 public SearchModule(SharedData shared, DBService db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.MidnightBlue;
 }
コード例 #59
0
 public SafeVariableDataGenerator(SharedData data)
 {
     this.data = data;
 }
コード例 #60
0
 public LinkfilterModule(SharedData shared, DatabaseContextBuilder db)
     : base(shared, db)
 {
     this.ModuleColor = DiscordColor.DarkRed;
 }