private void CreateNode(BaseMember member) { if (member == null) { return; } var prefab = member.m_memberType == MemberType.Player ? m_playerPrefab : m_enemyPrefab; if (prefab == null) { return; } if (m_parent == null) { return; } var obj = GameObject.Instantiate <GameObject>(prefab); if (obj == null) { return; } obj.transform.SetParent(m_parent); obj.transform.localScale = Vector3.one; obj.SetActive(true); UIHPNode node = obj.GetComponent <UIHPNode>(); if (node == null) { return; } node.SetMember(member); node.OnInit(); m_nodes.Add(node); }
public static int Neu(DateTime date, User usr, BaseMember bv, DateTime start) { var RETURN = -1; var query = @" Insert INTO [Dienste.DienstTag] (Datum, AV, BV, Beginn, Abgeschlossen, Stand, Bearbeiter, Ersteller) Values (@AD, @AV, @BV, @DatA, @AbG, @Std, @Beb, @Erst) Select Cast(scope_identity() AS int)"; var cmd = new SqlCommand(query, sqlConn); { var withBlock = cmd.Parameters; withBlock.Add("@AD", SqlDbType.Date).Value = date.ToString("o"); withBlock.Add("@AV", SqlDbType.Int).Value = usr.LoginID; withBlock.Add("@BV", SqlDbType.Int).Value = bv.MemberID; withBlock.Add("@DatA", SqlDbType.DateTime).Value = start.ToString("o"); withBlock.Add("@AbG", SqlDbType.Bit).Value = 0; withBlock.Add("@Std", SqlDbType.DateTime).Value = DateTime.UtcNow.ToString("o"); withBlock.Add("@Beb", SqlDbType.Int).Value = usr.LoginID; withBlock.Add("@Erst", SqlDbType.Int).Value = usr.LoginID; } try { sqlConn.Open(); RETURN = (int)cmd.ExecuteScalar(); } finally { sqlConn.Close(); WriteLog($"{usr.UserName} hat einen Neuen Dienst mit der ID {RETURN} erstellt"); } return(RETURN); }
public BaseMember AddMemInCountry(BaseMember mem, uint memID) { mem.selfDataValue.m_data.m_u4IDNum = memID; //为出生对象增加“对象省份证”信息 ushort targetID = mem.selfDataValue.m_data.m_u2ID; countryMems.Add(memID, mem); //将出生对象加入到对应国家中 countryIDCenter.objects.Add(memID); //将出生对象“对象省份证”信息存入 sameTypeNum[(ENUM_OBJECT_NAME)targetID]++; //将出生对象“同类型对象数”的个数累加 return(mem); }
public void SetSelectInfo(BaseMember value) { Init(); mBaseMember = value; maskProgressMax = mBaseMember.selfDataValue.m_atrr.m_u2MakeTime; maskProgressNow = maskProgressMax; cubeSoliderObject = Resources.Load(mBaseMember.selfDataValue.m_data.self) as GameObject; selectName.text = mBaseMember.selfDataValue.m_data.selfName; selectHeadP.texture = Resources.Load(mBaseMember.selfDataValue.m_data.selfHeadP) as Texture; }
private bool IsExist(uint memID, BaseMember mem) { //mem为空是删除的或滤器 if (mem.selfDataValue == null) { return(buildMems.ContainsKey(memID)); } else //检测是否是建筑标签 { if (mem.selfDataValue.m_data.m_emObjectType == ENUM_OBJECT_TYPE.OBJECT_BUILD) { return(true); } else { return(false); } } }
public void AddMem(BaseMember mem) { uint memID = mem.selfDataValue.m_data.m_u4IDNum; if (IsExist(memID, mem)) { BuildMem buildMem = (BuildMem)mem; buildMems.Add(memID, buildMem); ushort id = mem.selfDataValue.m_data.m_u2ID; switch (id) { case 1500: activeBuildDict[0].Add(buildMem); break; case 1502: activeBuildDict[1].Add(buildMem); break; case 1503: activeBuildDict[2].Add(buildMem); break; case 1504: activeBuildDict[3].Add(buildMem); break; case 1505: activeBuildDict[4].Add(buildMem); break; default: break; } if (countryID == 1) { GameOperation.gameOperation.UpdateNativeBuildLabCount(); } } }
//项目选择结束后的操作 public void CancelSelfInvoke(bool isbulding) { if (isInit == false) { Init(); } if (isbulding == true) //对象选择成功,让父面板显示之前隐藏的Bar中的所有项目,并更新“对象系统” { m_parentPanel.NotHideSelfAllSelectItem(); BaseMember baseMember = GetCurrObjectScript(mBaseMember.selfDataValue.m_data.m_emObjectName); GameOperation.gameOperation.AddMemInCountry(1, baseMember); cubeBuild.AddComponent <BuildOnClick>().SetMemeber = baseMember; } else //对象选择失败,销毁数遍按下时生成的未激活对象模型 { Destroy(cubeBuild.gameObject); } //Debug.Log("OnUp"); }
public void BuildMakeObject(BaseMember mem) { mBuildSystem.BuildMakeObject(mem); }
public void AddMem(BaseMember mem, uint memID) { BaseMember memT = mObjectSystem.AddMemInCountry(mem, memID); mBuildSystem.AddMem(memT); }
private void DeleteMemberAsync(Contact contact, ServiceName serviceName, RoleLists list, DeleteMemberCompletedEventHandler callback) { if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null) { OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("DeleteMember", new MSNPSharpException("You don't have access right on this action anymore."))); return; } // check whether the update is necessary if (!contact.HasLists(list)) { return; } RoleId memberRole = ContactList.GetMemberRole(list); if (memberRole == RoleId.None) { return; } Service service = AddressBook.SelectTargetService(serviceName); if (service == null) { AddServiceAsync(serviceName, delegate { // RESURSIVE CALL DeleteMemberAsync(contact, serviceName, list, callback); }); return; } DeleteMemberRequestType deleteMemberRequest = new DeleteMemberRequestType(); deleteMemberRequest.serviceHandle = new HandleType(); deleteMemberRequest.serviceHandle.Id = service.Id.ToString(); deleteMemberRequest.serviceHandle.Type = serviceName; Membership memberShip = new Membership(); memberShip.MemberRole = memberRole; BaseMember deleteMember = null; // BaseMember is an abstract type, so we cannot create a new instance. // If we have a MembershipId different from 0, just use it. Otherwise, use email or phone number. BaseMember baseMember = AddressBook.SelectBaseMember(serviceName, contact.Account, contact.ClientType, memberRole); int membershipId = (baseMember == null) ? 0 : baseMember.MembershipId; switch (contact.ClientType) { case IMAddressInfoType.WindowsLive: deleteMember = new PassportMember(); deleteMember.Type = (baseMember == null) ? MembershipType.Passport : baseMember.Type; deleteMember.State = (baseMember == null) ? MemberState.Accepted : baseMember.State; if (membershipId == 0) { (deleteMember as PassportMember).PassportName = contact.Account; } else { deleteMember.MembershipId = membershipId; deleteMember.MembershipIdSpecified = true; } break; case IMAddressInfoType.Yahoo: case IMAddressInfoType.OfficeCommunicator: deleteMember = new EmailMember(); deleteMember.Type = MembershipType.Email; deleteMember.State = (baseMember == null) ? MemberState.Accepted : baseMember.State; if (membershipId == 0) { (deleteMember as EmailMember).Email = contact.Account; } else { deleteMember.MembershipId = membershipId; deleteMember.MembershipIdSpecified = true; } break; case IMAddressInfoType.Telephone: deleteMember = new PhoneMember(); deleteMember.Type = MembershipType.Phone; deleteMember.State = (baseMember == null) ? MemberState.Accepted : baseMember.State; if (membershipId == 0) { (deleteMember as PhoneMember).PhoneNumber = contact.Account; } else { deleteMember.MembershipId = membershipId; deleteMember.MembershipIdSpecified = true; } break; case IMAddressInfoType.Circle: deleteMember = new CircleMember(); deleteMember.Type = MembershipType.Circle; deleteMember.State = (baseMember == null) ? MemberState.Accepted : baseMember.State; (deleteMember as CircleMember).CircleId = contact.AddressBookId.ToString("D").ToLowerInvariant(); break; } memberShip.Members = new BaseMember[] { deleteMember }; deleteMemberRequest.memberships = new Membership[] { memberShip }; MsnServiceState DeleteMemberObject = new MsnServiceState(PartnerScenario.ContactMsgrAPI, "DeleteMember", true); SharingServiceBinding sharingService = (SharingServiceBinding)CreateService(MsnServiceType.Sharing, DeleteMemberObject); sharingService.DeleteMemberCompleted += delegate(object srv, DeleteMemberCompletedEventArgs e) { OnAfterCompleted(new ServiceOperationEventArgs(sharingService, MsnServiceType.Sharing, e)); if (e.Cancelled || NSMessageHandler.MSNTicket == MSNTicket.Empty) { return; } // Update AB AddressBook.RemoveMemberhip(serviceName, contact.Account, contact.ClientType, memberRole); if (callback != null) { callback(srv, e); } }; RunAsyncMethod(new BeforeRunAsyncMethodEventArgs(sharingService, MsnServiceType.Sharing, DeleteMemberObject, deleteMemberRequest)); }
private void AddMemberAsync(Contact contact, ServiceName serviceName, RoleLists list, AddMemberCompletedEventHandler callback) { if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null) { OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("AddMember", new MSNPSharpException("You don't have access right on this action anymore."))); return; } // check whether the update is necessary if (contact.HasLists(list)) { return; } RoleId memberRole = ContactList.GetMemberRole(list); if (memberRole == RoleId.None) { return; } Service service = AddressBook.SelectTargetService(serviceName); if (service == null) { AddServiceAsync(serviceName, delegate { // RESURSIVE CALL AddMemberAsync(contact, serviceName, list, callback); }); return; } AddMemberRequestType addMemberRequest = new AddMemberRequestType(); addMemberRequest.serviceHandle = new HandleType(); addMemberRequest.serviceHandle.Id = service.Id.ToString(); addMemberRequest.serviceHandle.Type = serviceName; Membership memberShip = new Membership(); memberShip.MemberRole = memberRole; BaseMember member = null; // Abstract if (contact.ClientType == IMAddressInfoType.WindowsLive) { member = new PassportMember(); PassportMember passportMember = member as PassportMember; passportMember.PassportName = contact.Account; passportMember.State = MemberState.Accepted; passportMember.Type = MembershipType.Passport; } else if (contact.ClientType == IMAddressInfoType.Yahoo || contact.ClientType == IMAddressInfoType.OfficeCommunicator) { member = new EmailMember(); EmailMember emailMember = member as EmailMember; emailMember.State = MemberState.Accepted; emailMember.Type = MembershipType.Email; emailMember.Email = contact.Account; emailMember.Annotations = new Annotation[] { new Annotation() }; emailMember.Annotations[0].Name = AnnotationNames.MSN_IM_BuddyType; emailMember.Annotations[0].Value = (contact.ClientType == IMAddressInfoType.Yahoo) ? "32:" : "02:"; } else if (contact.ClientType == IMAddressInfoType.Telephone) { member = new PhoneMember(); PhoneMember phoneMember = member as PhoneMember; phoneMember.State = MemberState.Accepted; phoneMember.Type = MembershipType.Phone; phoneMember.PhoneNumber = contact.Account; } else if (contact.ClientType == IMAddressInfoType.Circle) { member = new CircleMember(); CircleMember circleMember = member as CircleMember; circleMember.Type = MembershipType.Circle; circleMember.State = MemberState.Accepted; circleMember.CircleId = contact.AddressBookId.ToString("D").ToLowerInvariant(); } if (member == null) { return; } memberShip.Members = new BaseMember[] { member }; addMemberRequest.memberships = new Membership[] { memberShip }; MsnServiceState AddMemberObject = new MsnServiceState(PartnerScenario.ContactMsgrAPI, "AddMember", true); SharingServiceBinding sharingService = (SharingServiceBinding)CreateService(MsnServiceType.Sharing, AddMemberObject); sharingService.AddMemberCompleted += delegate(object srv, AddMemberCompletedEventArgs e) { OnAfterCompleted(new ServiceOperationEventArgs(sharingService, MsnServiceType.Sharing, e)); if (e.Cancelled || NSMessageHandler.MSNTicket == MSNTicket.Empty) { return; } // Update AB AddressBook.AddMemberhip(serviceName, contact.Account, contact.ClientType, memberRole, member); if (callback != null) { callback(srv, e); } }; RunAsyncMethod(new BeforeRunAsyncMethodEventArgs(sharingService, MsnServiceType.Sharing, AddMemberObject, addMemberRequest)); }
public void BuildMakeObject(BaseMember mem) { }
public void AddMemInCountry(ushort idCountryCount, BaseMember mem) { mObjectOperation.AddMemInCountry(idCountryCount, mem); }
public void AddMemInCountry(ushort countryID, BaseMember mem) { ++objectID; countryDict[countryID].AddMem(mem, objectID); }
public virtual void AddMakeObject(UInt16 countryID, BaseMember mem) { this.countryID = countryID; makeObjectList.Add(mem); }
public void SetMember(BaseMember member) { m_target = member; }