public AutoPlayer CreateAutoPlayer(Scene _this, LogicSimpleData logic, SceneSimpleData scene, Vector2 pos, Vector2 dir) { var autoPlayer = new AutoPlayer(); autoPlayer.Init(_this.GenerateNextId(), logic, scene); if (!_this.ValidPosition(pos)) { Logger.Error("CreateAutoPlayer postion is invalid. PlayerId={2},name={0}, pos={1}", autoPlayer.GetName(), pos, logic.Id); } autoPlayer.SetPosition(pos.X, pos.Y); autoPlayer.SetDirection(dir); _this.EnterScene(autoPlayer); return(autoPlayer); }
/// <summary> /// 初始化 /// </summary> /// <param name="_this"></param> /// <param name="npcId"></param> /// <param name="logic"></param> /// <param name="scene"></param> public void Init(AutoPlayer _this, ulong npcId, LogicSimpleData logic, SceneSimpleData scene) { _this.mLogicData = logic; _this.mSceneData = scene; _this.mObjId = npcId; _this.mTypeId = logic.TypeId; _this.mDirection = new Vector2(1, 0); _this.mName = _this.mSceneData.Name; _this.BuffList = new BuffList(); _this.BuffList.InitByBase(_this); _this.Attr = new FightAttr(_this); _this.Skill = new SkillManager(_this); _this.SetLevel(_this.mLogicData.Level); _this.InitTableData(_this.mLogicData.Level); _this.InitEquip(_this.mLogicData.Level); _this.InitSkill(_this.mLogicData.Level); _this.InitBuff(_this.mLogicData.Level); _this.Attr.RobotPlayer = true; _this.InitAttr(_this.mLogicData.Level); _this.mCamp = 2; _this.TableCamp = Table.GetCamp(_this.mCamp); _this.InitAI(_this.mLogicData.Level); }
public void PushSimpleData(FriendData _this, SceneSimpleData result, bool isOnline) { var temp = new CharacterSimpleData { Id = result.Id, TypeId = result.TypeId, Name = result.Name, SceneId = result.SceneId, FightPoint = result.FightPoint, Level = result.Level, Ladder = result.Ladder, ServerId = result.ServerId }; if (isOnline) { temp.Online = 1; } else { temp.Online = 0; } _this.InfoData = temp; }
public AutoPlayer CreateAutoPlayer(LogicSimpleData logic, SceneSimpleData scene, Vector2 pos, Vector2 dir) { return(mImpl.CreateAutoPlayer(this, logic, scene, pos, dir)); }
/// <summary> /// 初始化 /// </summary> /// <param name="npcId"></param> /// <param name="logic"></param> /// <param name="scene"></param> public void Init(ulong npcId, LogicSimpleData logic, SceneSimpleData scene) { mImpl.Init(this, npcId, logic, scene); }
public void PushSimpleData(SceneSimpleData result, bool isOnline) { mImpl.PushSimpleData(this, result, isOnline); }