public MerchantGreen(Vector2 position) { Sprite = NPCSpriteFactory.Instance.CreateMerchantGreenSprite(); State = new NullState(); Position = position; Scale = 3f; DestinationRectangle = new Rectangle((int)Position.X, (int)Position.Y, (int)(width * Scale), (int)(height * Scale)); }
private void CheckAssignment(NullState variableState, NullState expressionState, ExpressionSyntax expression) { if (variableState == NullState.ShouldNotBeNull) { switch (expressionState) { case NullState.Null: case NullState.CouldBeNull: context.ReportDiagnostic(Diagnostic.Create(PossibleNullAssignment, expression.GetLocation())); break; } } }
private void getNullState(IEdge e) { NullState edgeNullState = (NullState)this.edgeNullStates[e]; NullState vertexNullState = (NullState)this.vertexNullStates[e.Target]; if (vertexNullState != NullState.Uncertain) { this.nullState = vertexNullState; } else { this.nullState = edgeNullState; } }
public override bool Equals(object obj) { if (obj == this) { return(true); } NullState other = obj as NullState; if (other == null) { return(false); } return(this.Context == other.Context && base.Equals(other)); }
private void updateBrTrueFalse() { // check if brtrue bool isBrTrue = target.Instruction.OpCode.ToString() == "brtrue.s"; bool isBrFalse = target.Instruction.OpCode.ToString() == "brfalse.s"; if (isBrTrue || isBrFalse) { // log.WriteLine("Found {0} {1}",target.Instruction, target.Instruction.Value); // check if argument before if (isSourceArgument()) { NullState then = NullState.Null; NullState else_ = NullState.NonNull; if (isBrFalse) { then = NullState.NonNull; else_ = NullState.Null; } // this edge represents if (arg==null) // the "then" edge, will be null, // the "else edge, will be non-null foreach (IEdge e in this.graph.OutEdges(target)) { Instruction il = ((InstructionVertex)e.Target).Instruction; // then sbyte targetOffset = (sbyte)target.Instruction.Value; if (il.Offset != targetOffset) { this.edgeNullStates[e] = then; this.vertexNullStates[target] = then; } else { this.edgeNullStates[e] = else_; this.vertexNullStates[target] = else_; } } } } }
private void getNullState(IEdge e) { NullState edgeNullState = (NullState)this.edgeNullStates[e]; NullState vertexNullState = (NullState)this.vertexNullStates[e.Target]; if (vertexNullState != NullState.Uncertain) this.nullState=vertexNullState; else this.nullState=edgeNullState; }