public DirectStMtdCall( Text.Span span, GenericQualifiedName className, Text.Span classNamePosition, Name methodName, Text.Span methodNamePosition, CallSignature signature) : base(span, className, classNamePosition, signature) { this.methodName = new NameRef(methodNamePosition, methodName); }
private void ReadInterfaceEntity(NameRef nr) { SymScope ss = CreateInterfaceMember(nr.offset, nr.name); if (ss != null) { cur_scope.AddName(nr.name, ss); } }
public TraitAdaptationAlias(Text.Span span, Tuple <TypeRef, NameRef> /*!*/ oldname, NameRef newname, PhpMemberAttributes?newmodifier) : base(span, oldname) { if (oldname == null) { throw new ArgumentNullException("oldname"); } this.NewName = newname; this.NewModifier = newmodifier; }
public NamedTypeDecl( Text.Span span, Text.Span headingSpan, bool isConditional, PhpMemberAttributes memberAttributes, bool isPartial, NameRef className, IList <FormalTypeParam> /*!*/ genericParams, INamedTypeRef baseClass, IList <INamedTypeRef> /*!*/ implementsList, IList <TypeMemberDecl> /*!*/ elements, Text.Span bodySpan) : base(span, headingSpan, isConditional, memberAttributes, isPartial, genericParams, baseClass, implementsList, elements, bodySpan) { Debug.Assert(genericParams != null && implementsList != null && elements != null); Debug.Assert((memberAttributes & PhpMemberAttributes.Trait) == 0 || (memberAttributes & PhpMemberAttributes.Interface) == 0, "Interface cannot be a trait"); this.name = className; }
/// <summary> /// Create new method declaration. /// </summary> /// <param name="span">Entire span.</param> /// <param name="name">Method name.</param> /// <param name="aliasReturn"><c>true</c> if method returns alias, <c>false</c> otherwise.</param> /// <param name="formalParams">Parameters.</param> /// <param name="paramsSpan">Span of the parameters including parentheses.</param> /// <param name="genericParams">Generic parameters.</param> /// <param name="body">Method content.</param> /// <param name="modifiers">Method modifiers, visibility etc.</param> /// <param name="baseCtorParams">Parameters for the base class constructor.</param> /// <param name="returnType">Return type hint, optional.</param> public MethodDecl(Text.Span span, NameRef name, bool aliasReturn, IList <FormalParam> /*!*/ formalParams, Text.Span paramsSpan, IList <FormalTypeParam> /*!*/ genericParams, BlockStmt body, PhpMemberAttributes modifiers, IList <ActualParam> baseCtorParams, TypeRef returnType) : base(span, modifiers) { Debug.Assert(genericParams != null && formalParams != null); this.name = name; this.signature = new Signature(aliasReturn, formalParams, paramsSpan); this.typeSignature = new TypeSignature(genericParams); this.body = body; this.baseCtorParams = baseCtorParams.AsArray(); this.returnType = returnType; }
public FunctionDecl( Text.Span span, bool isConditional, PhpMemberAttributes memberAttributes, NameRef /*!*/ name, bool aliasReturn, IList <FormalParam> /*!*/ formalParams, Text.Span paramsSpan, IList <FormalTypeParam> /*!*/ genericParams, BlockStmt /*!*/ body, TypeRef returnType) : base(span) { Debug.Assert(genericParams != null && formalParams != null && body != null); this.name = name; this.signature = new Signature(aliasReturn, formalParams, paramsSpan); this.typeSignature = new TypeSignature(genericParams); this.body = body; this.IsConditional = isConditional; this.MemberAttributes = memberAttributes; this.returnType = returnType; }
//通过服务端给的数据得到对应的名字 void UpdateNameValue() { int Id = 0; if (int.TryParse(GameCenter.miracleMng.targetName, out Id)) { int nameId = Id / 100; NameRef nameRef = ConfigMng.Instance.GetNameRef(nameId); string name = nameRef != null ? nameRef.Firstname : string.Empty; nameRef = ConfigMng.Instance.GetNameRef(Id % 100); name += (nameRef != null && nameRef.names.Count >= GameCenter.miracleMng.profInfo) ? nameRef.names[GameCenter.miracleMng.profInfo - 1] : string.Empty; yourName.text = name; } else { yourName.text = GameCenter.miracleMng.targetName; } }
/// <summary> /// 随机名字 /// </summary> void RandName(GameObject _obj) { int curProf = GameCenter.mainPlayerMng.MainPlayerInfo.Prof; int profCount = ConfigMng.Instance.ProfNameCount(curProf); int nameCount = ConfigMng.Instance.GetNameRefTable().Count; if (profCount <= 0 || nameCount <= 0) { Debug.LogError("NameConfig配表数据不对,职业" + curProf + "的名字或者性配表长度为0,去找左文祥"); return; } int profId = random.Next(1, profCount); int nameId = random.Next(1, nameCount); NameRef nameRef = ConfigMng.Instance.GetNameRef(nameId); string name = nameRef != null ? nameRef.Firstname : string.Empty; nameRef = ConfigMng.Instance.GetNameRef(profId); name += (nameRef != null && nameRef.names.Count >= curProf) ? nameRef.names[curProf - 1] : string.Empty; inputName.value = name; }
public FunctionDecl( Text.Span span, List <FunctionAttribute> attr, bool isConditional, PhpMemberAttributes memberAttributes, NameRef /*!*/ name, bool aliasReturn, List <FormalParam> /*!*/ formalParams, Text.Span paramsSpan, List <FormalTypeParam> /*!*/ genericParams, BlockStmt /*!*/ body, List <CustomAttribute> attributes, TypeRef returnType) : base(span) { Debug.Assert(genericParams != null && formalParams != null && body != null); this.attr = attr; this.name = name; this.signature = new Signature(aliasReturn, formalParams); this.typeSignature = new TypeSignature(genericParams); if (attributes != null && attributes.Count != 0) { this.Attributes = new CustomAttributes(attributes); } this.body = body; this.parametersSpan = paramsSpan; this.IsConditional = isConditional; this.MemberAttributes = memberAttributes; this.returnType = returnType; }
public DirectStMtdCall(Text.Span span, GenericQualifiedName className, Text.Span classNamePosition, Name methodName, Text.Span methodNamePosition, IList <ActualParam> parameters, IList <TypeRef> genericParams) : base(span, className, classNamePosition, parameters, genericParams) { this.methodName = new NameRef(methodNamePosition, methodName); }
private static NameOfMethod ToNameOfMethod(NameRef e) { return(new NameOfMethod(e.Name.Value)); }
private static NameOfFunction ToNameOfFunction(NameRef e) { return(new NameOfFunction(e.Name.Value)); }
private static NameOfClass ToNameOfClass(NameRef e) { return(new NameOfClass(e.Name.Value)); }
public virtual LangElement TraitAdaptationAlias(Span span, Tuple <TypeRef, NameRef> name, NameRef identifierOpt, PhpMemberAttributes?attributeOpt) { return(new TraitsUse.TraitAdaptationAlias(span, name, identifierOpt, attributeOpt)); }
void Awake() { mutualExclusion = false; Layer = GUIZLayer.NORMALWINDOW; if (btnReturn != null) { UIEventListener.Get(btnReturn).onClick = delegate { GameCenter.instance.GoPassWord(); } } ; if (btnName != null) { UIEventListener.Get(btnName).onClick = delegate { UpdateNameValue(); } } ; } // protected List<string> nameList = new List<string>(); // int index = 0; void UpdateNameValue() { int profCount = ConfigMng.Instance.ProfNameCount(curProf); int nameCount = ConfigMng.Instance.GetNameRefTable().Count; if (profCount <= 0 || nameCount <= 0) { Debug.LogError("NameConfig配表数据不对,职业" + curProf + "的名字或者性配表长度为0,去找左文祥"); return; } //System.Random profRan = new System.Random(); int profId = R.Next(1, profCount); //System.Random nameRan = new System.Random(); int nameId = R.Next(1, nameCount); NameRef nameRef = ConfigMng.Instance.GetNameRef(nameId); string name = nameRef != null ? nameRef.Firstname : string.Empty; nameRef = ConfigMng.Instance.GetNameRef(profId); name += (nameRef != null && nameRef.names.Count >= curProf) ? nameRef.names[curProf - 1] : string.Empty; // index++; // if(nameList.Contains(name)) // { // Debug.Log("随机到重复名字:"+name+",index:"+(index)+",nameId:"+nameId+",profId:"+profId); // }else // { // nameList.Add(name); // } input.value = name; } void ShowPlayerDes(GameObject games) { curProf = (int)UIEventListener.Get(games).parameter; ShowPreviewSingle(curProf); UpdateNameValue(); } void ShowPreviewSingle(int _prof) { PlayerBaseInfo info = new PlayerBaseInfo(_prof, _prof, true); if (info == null) { return; } CharacterCreateStage state = GameCenter.curGameStage as CharacterCreateStage; if (state != null) { state.CurSelectRole = info; } if (btnCreate != null) { UIEventListener.Get(btnCreate).parameter = info; UIEventListener.Get(btnCreate).onClick = Create; } } void Create(GameObject _go) { if (_go == null) { return; } PlayerBaseInfo info = UIEventListener.Get(_go).parameter as PlayerBaseInfo; if (!GameCenter.loginMng.FontHasAllCharacter(input.label.bitmapFont, input.value) || GameCenter.loginMng.CheckName(input.value)) { GameCenter.messageMng.AddClientMsg(490); return; } GameCenter.loginMng.C2S_ReqCreateChar(info.Prof, input.value); } void ShowPlayers() { for (int i = 0; i < players.Length; i++) { if (players[i] != null) { UIEventListener.Get(players[i]).onClick = ShowPlayerDes; UIEventListener.Get(players[i]).parameter = i + 1; } } }
public override LangElement TraitAdaptationAlias(Span span, Tuple <QualifiedNameRef, NameRef> name, NameRef identifierOpt, PhpMemberAttributes?attributeOpt) => CountLE(base.TraitAdaptationAlias(span, name, identifierOpt, attributeOpt));
public DirectStMtdCall(Text.Span span, TypeRef targetType, NameRef nameRef, CallSignature signature) : base(span, targetType, signature) { this.methodName = nameRef; }
public DirectStMtdCall(Text.Span span, ClassConstUse /*!*/ classConstant, IList <ActualParam> /*!*/ parameters, IList <TypeRef> /*!*/ genericParams) : base(span, classConstant.TargetType, parameters, genericParams) { this.methodName = new NameRef(classConstant.NamePosition, classConstant.Name.Value); }