internal override VertexCollection GetVertices(PointF origin) { if (_cachedVerts != null) { return(_cachedVerts); } VertexCollection result = new VertexCollection() { Mode = BeginMode.LineStrip }; float deltaValue = 1f / (float)Resolution; for (int i = 0; i < Resolution; i++) { float value = (float)i * deltaValue; PointF interpolated01 = P0.LerpTo(P1, value); PointF interpolated12 = P1.LerpTo(P2, value); PointF interpolated23 = P2.LerpTo(P3, value); PointF interpolated01_12 = interpolated01.LerpTo(interpolated12, value); PointF interpolated12_23 = interpolated12.LerpTo(interpolated23, value); PointF interpolatedFinal = interpolated01_12.LerpTo(interpolated12_23, value); result.Add(interpolatedFinal.Add(Position)); } result = base.RotateVerts(result); _cachedVerts = result; return(_cachedVerts); }
public Spectrum Tr(Scene scene, Sampler sampler) { Ray ray = new Ray(P0.SpawnRayTo(P1)); Spectrum Tr = Spectrum.Create(1.0); while (true) { SurfaceInteraction isect; bool hitSurface = scene.Intersect(ray, out isect); // Handle opaque surface along ray's path if (hitSurface && isect.Primitive.GetMaterial() != null) { return(Spectrum.Create(0.0)); } // Update transmittance for current ray segment if (ray.Medium != null) { Tr *= ray.Medium.Tr(ray, sampler); } // Generate next ray segment or return final transmittance if (!hitSurface) { break; } ray = isect.SpawnRayTo(P1); } return(Tr); }
public void loadInfo(Character chara, P0 p, RoomContraller roomController) { Debug.Log("开始读取记录。。。"); setCrazyFlag(p.CrazyFlag); setAbilityInfo(p.AbilityInfo); setMaxAbilityInfo(p.MaxAbilityInfo); setActionPointrolled(p.ActionPointrolled); setIsDead(p.IsDead); this.setDesc(p.Desc); this.setBoss(p.IsBoss); this.transform.position = new Vector3(p.CharaTransformPositionX, p.CharaTransformPositionY, p.CharaTransformPositionZ);; Debug.Log("读取基本信息完成。。。"); // Debug.Log("开始读取道具信息。。。"); foreach (ItemInfo i in p.Bag) { if (i.Type == ItemConstant.ITEM_TYPE_POTION) { getBag().insertItem(new ItemPotion(i.Code, i.Name, i.Desc)); } } // Debug.Log("读取道具信息完成。。。"); // Debug.Log("开始读取游戏进度信息。。。"); foreach (string roomType in p.TargetRoomlist) { this.getTargetRoomList().Enqueue(roomController.findRoomByRoomType(roomType)); } // Debug.Log("读取游戏进度信息完成。。。"); updateActionPoint(p.ActionPoint); if (this.isPlayer()) { FindObjectOfType <CameraCtrl>().setTargetPos(p.Xyz); } }
public virtual void init(P0 benMonster) { setAbilityInfo(benMonster.AbilityInfo); setMaxAbilityInfo(benMonster.MaxAbilityInfo); setActionPointrolled(benMonster.ActionPointrolled); setIsDead(benMonster.IsDead); }
public bool Equals(CubicBezierCurve3D other) { return(P0.Equals(other.P0) && P1.Equals(other.P1) && P2.Equals(other.P2) && P3.Equals(other.P3)); }
/// <summary> /// Compares this object with the specified object for order. /// Uses the standard lexicographic ordering for the points in the LineSegment. /// </summary> /// <param name="o"> /// The <c>LineSegment</c> with which this <c>LineSegment</c> /// is being compared. /// </param> /// <returns> /// A negative integer, zero, or a positive integer as this <c>LineSegment</c> /// is less than, equal to, or greater than the specified <c>LineSegment</c>. /// </returns> public int CompareTo(object o) { var other = (LineSegment)o; var comp0 = P0.CompareTo(other.P0); return(comp0 != 0 ? comp0 : P1.CompareTo(other.P1)); }
internal void Init(BoardOutward board, int observeTeam) { Board = board; ObserveTeam = observeTeam; Player0.ItemsSource = board.Players[observeTeam, 0].Balls; PlayerO0.ItemsSource = board.Players[1 - observeTeam, 0].Balls; P0.SetPokemon(board[observeTeam, 0]); PO0.SetPokemon(board[1 - observeTeam, 0]); if (Board.Settings.Mode.PlayersPerTeam() == 2) { Player1.ItemsSource = board.Players[observeTeam, 1].Balls; PlayerO1.ItemsSource = board.Players[1 - observeTeam, 1].Balls; P1.SetPokemon(board[observeTeam, 1]); PO1.SetPokemon(board[1 - observeTeam, 1]); } else { Player1.ItemsSource = PlayerO1.ItemsSource = null; P1.SetPokemon(null); PO1.SetPokemon(null); } board.PokemonSentOut += OnPokemonSentOut; if (Board.Settings.Mode.PlayersPerTeam() != 2) { p4p.Visibility = System.Windows.Visibility.Collapsed; p4p2.Visibility = System.Windows.Visibility.Collapsed; } else { p4p.Visibility = System.Windows.Visibility.Visible; p4p2.Visibility = System.Windows.Visibility.Visible; } }
/// <summary> /// allocate correct pool type and add it to types /// </summary> internal static AbstractStoragePool newPool(string name, AbstractStoragePool superPool, List <AbstractStoragePool> types) { try { switch (name) { case "properties": return(superPool = new P0(types.Count)); case "system": return(superPool = new P1(types.Count, (P0)superPool)); default: if (null == superPool) { return(superPool = new BasePool <SkillObject>(types.Count, name, AbstractStoragePool.noKnownFields, AbstractStoragePool.NoAutoFields)); } else { return(superPool = superPool.makeSubPool(types.Count, name)); } } } finally { types.Add(superPool); } }
public Spectrum Tr(IScene scene, ISampler sampler) { var ray = P0.SpawnRayTo(P1); Spectrum tr = Spectrum.One; while (true) { var si = new SurfaceInteraction(); var hitSurface = scene.Intersect(ray, ref si); if (hitSurface && !(si.Primitive.Material is null)) { return(Spectrum.Zero); } if (!(ray.Medium is null)) { tr *= ray.Medium.Tr(ray, sampler); } if (!hitSurface) { break; } ray = si.SpawnRayTo(P1); } return(tr); }
public override int GetHashCode() { unchecked { return((P0.GetHashCode() * 397) ^ P1.GetHashCode()); } }
public f5([email protected] type, P0 owner) : base(type, "varr", owner) { if (false)//TODO type check!) { throw new SkillException("Expected field type v64[] in Container.varr but found " + type); } // TODO insert known restrictions? }
public f1([email protected] type, P0 owner) : base(type, "edges", owner) { if (false)//TODO type check!) { throw new SkillException("Expected field type set<node> in Node.edges but found " + type); } // TODO insert known restrictions? }
public f2([email protected] type, P0 owner) : base(type, "two", owner) { if (type.TypeID != 14) { throw new SkillException("Expected field type string in Unicode.two but found " + type); } // TODO insert known restrictions? }
public f4([email protected] type, P0 owner) : base(type, "e", owner) { if (type.TypeID != 4) { throw new SkillException("Expected field type v64 in Constant.e but found " + type); } // TODO insert known restrictions? }
public override Expression GetExpression(ExpressionParsingContext context) { var target = P0.GetExpression(context); var targetType = target.Type; var member = targetType.GetMember(P2.Value); return(Expression.MakeMemberAccess(target, member[0])); }
public f1([email protected] type, P0 owner) : base(type, "boolean", owner) { if (type.TypeID != 6) { throw new SkillException("Expected field type bool in Boolean.boolean but found " + type); } // TODO insert known restrictions? }
public f0([email protected] type, P0 owner) : base(type, "bool", owner) { if (!((AbstractStoragePool)(de.ust.skill.common.csharp.api.FieldType)type).Name.Equals("boolean")) { throw new SkillException("Expected field type boolean in Boolean.bool but found " + type); } // TODO insert known restrictions? }
public f4([email protected] type, P0 owner) : base(type, "zero", owner) { if (type.TypeID != 13) { throw new SkillException("Expected field type f64 in DoubleTest.zero but found " + type); } // TODO insert known restrictions? }
public f4([email protected] type, P0 owner) : base(type, "someset", owner) { if (false)//TODO type check!) { throw new SkillException("Expected field type set<somethingelse> in Container.someSet but found " + type); } // TODO insert known restrictions? }
public f1([email protected] type, P0 owner) : base(type, "next", owner) { if (!((AbstractStoragePool)(de.ust.skill.common.csharp.api.FieldType)type).Name.Equals("testenum")) { throw new SkillException("Expected field type testenum in TestEnum.next but found " + type); } // TODO insert known restrictions? }
public f0([email protected] type, P0 owner) : base(type, "number", owner) { if (type.TypeID != 10) { throw new SkillException("Expected field type i64 in Number.number but found " + type); } // TODO insert known restrictions? }
// Use this for initialization void Start() { roomContraller = FindObjectOfType <RoomContraller>(); diceRoll = FindObjectOfType <DiceRollCtrl>(); eventController = FindObjectOfType <EventController>(); roundController = FindObjectOfType <RoundController>(); battleController = FindObjectOfType <BattleController>(); //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>(); charaInfoManager = FindObjectOfType <CharaInfoManager>(); setGuangBoListener(FindObjectOfType <GuangBoListener>()); guangBoController = FindObjectOfType <GuangBoController>(); storyController = FindObjectOfType <StoryController>(); bss = new BlackSignStory(); this.setName(SystemConstant.P6_NAME); int[] roomXYZ; setBag(new Bag()); if (this.neworLoad) { roomXYZ = new int[] { 0, 0, RoomConstant.ROOM_Z_GROUND }; setCrazyFlag(false); //for test 4-->9 setAbilityInfo(new int[] { 7, 9, 6, 7 }); setMaxAbilityInfo(new int[] { 7, 9, 6, 7 }); setActionPointrolled(false); setIsDead(false); this.setDesc("外乡人."); this.waitPlan = false; setDistance(0); setCurrentRoom(roomXYZ); // this.setClickMessage(new string[] { "我就是来旅游的。" }); } else { P0 p = loadInfo(this.getName()); roomXYZ = p.Xyz; this.waitPlan = p.WaitPlan; setDistance(0); setCurrentRoom(roomXYZ); loadInfo(this, p, roomContraller); } //游戏一开始 所处的房间 默认房间的坐标为 0,0,0 this.roomContraller.findRoomByXYZ(roomXYZ).setChara(this); this.roomContraller.setCharaInMiniMap(roomXYZ, this, true); this.setClickMessage(this.roomContraller.findRoomByXYZ(roomXYZ).findSomethingNews(this).ToArray()); /* * Item item1 = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0006 * , ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME); * this.getBag().insertItem(item1); * Item item2 = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0007 * , ItemDesConstant.ITEM_CODE_SPEC_Y0007_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0007_DES); * this.getBag().insertItem(item2); */ }
public override void rsc(int i, int h, MappedInStream @in) { enums.TestEnum[] d = ((P0)owner).Data; P0 t = ((P0)(object)this.type); for (; i != h; i++) { d[i].next = (enums.TestEnum)t.getByID(@in.v32()); } }
public override void rsc(int i, int h, MappedInStream @in) { escaping.ZBoolean[] d = ((P0)owner).Data; P0 t = ((P0)(object)this.type); for (; i != h; i++) { d[i].Zbool = (escaping.ZBoolean)t.getByID(@in.v32()); } }
public override void rsc(int i, int h, MappedInStream @in) { unknown.A[] d = ((P0)owner).Data; P0 t = ((P0)(object)this.type); for (; i != h; i++) { d[i].a = (unknown.A)t.getByID(@in.v32()); } }
/// <summary> /// Compares this object with the specified object for order. /// Uses the standard lexicographic ordering for the points in the LineSegment. /// </summary> /// <param name="o"> /// The <c>LineSegment</c> with which this <c>LineSegment</c> /// is being compared. /// </param> /// <returns> /// A negative integer, zero, or a positive integer as this <c>LineSegment</c> /// is less than, equal to, or greater than the specified <c>LineSegment</c>. /// </returns> public int CompareTo(object o) { LineSegment other = (LineSegment)o; int comp0 = P0.CompareTo(other.P0); if (comp0 != 0) { return(comp0); } return(P1.CompareTo(other.P1)); }
public void processFile(String cameraFile) { try { positions.Clear(); using (StreamReader input = new StreamReader(cameraFile)) { string line; while ((line = input.ReadLine()) != null) { if (line != "") { Dictionary <string, string> p = Util.ParseKeyValueList(line); String P0, P1, P2; p.TryGetValue("P0", out P0); p.TryGetValue("P1", out P1); p.TryGetValue("P2", out P2); Double X, Y, Z; String[] values; values = P0.Split(';'); X = double.Parse(values[0]); Y = double.Parse(values[1]); Z = double.Parse(values[2]); positions.Add(new Vector3((float)X, (float)Y, (float)Z)); values = P1.Split(';'); X = double.Parse(values[0]); Y = double.Parse(values[1]); Z = double.Parse(values[2]); positions.Add(new Vector3((float)X, (float)Y, (float)Z)); values = P2.Split(';'); X = double.Parse(values[0]); Y = double.Parse(values[1]); Z = double.Parse(values[2]); positions.Add(new Vector3((float)X, (float)Y, (float)Z)); } } } if (positions.Count % 3 != 0 || positions.Count == 0) { defaultCamera(); } } catch (Exception ex) { defaultCamera(); } }
/// <summary> /// Computes the closest point on this line segment to another point. /// </summary> /// <param name="p">The point to find the closest point to.</param> /// <returns> /// A Coordinate which is the closest point on the line segment to the point p. /// </returns> public ICoordinate ClosestPoint(ICoordinate p) { var factor = ProjectionFactor(p); if (factor > 0 && factor < 1) { return(Project(p)); } var dist0 = P0.Distance(p); var dist1 = P1.Distance(p); return(dist0 < dist1 ? P0 : P1); }
public override Expression GetExpression(ExpressionParsingContext context) { var call = P0 as DotExpressionNode; if (call != null) { return(Expression.Call(call.P0.GetExpression(context), call.P2.Value, null, P2.GetExpressions(context))); } else { return(Expression.Invoke(P0.GetExpression(context), P2.GetExpressions(context))); } }
// Use this for initialization void Start() { roomContraller = FindObjectOfType <RoomContraller>(); diceRoll = FindObjectOfType <DiceRollCtrl>(); eventController = FindObjectOfType <EventController>(); roundController = FindObjectOfType <RoundController>(); battleController = FindObjectOfType <BattleController>(); //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>(); charaInfoManager = FindObjectOfType <CharaInfoManager>(); setGuangBoListener(FindObjectOfType <GuangBoListener>()); guangBoController = FindObjectOfType <GuangBoController>(); storyController = FindObjectOfType <StoryController>(); bss = new BlackSignStory(); this.setName(SystemConstant.P4_NAME); setDistance(-0.5f); //游戏一开始 所处的房间 默认房间的坐标为 0,0,0 int[] roomXYZ; setBag(new Bag()); if (this.neworLoad) { roomXYZ = new int[] { 0, 0, RoomConstant.ROOM_Z_GROUND }; setCrazyFlag(false); setAbilityInfo(new int[] { 8, 3, 6, 7 }); setMaxAbilityInfo(new int[] { 8, 3, 6, 7 }); setActionPointrolled(false); setIsDead(false); this.setDesc("看似小萝莉,其实是一个出名的侦探。"); this.waitPlan = false; setTargetChara(new List <string>()); getTargetChara().Add(SystemConstant.P2_NAME); // this.setClickMessage(new string[] { "真相只有一个。", "你就是犯人。" }); getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_SURGERY)); getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_TRI_OPERATION)); getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_MORGUE)); getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_STORE)); } else { P0 p = loadInfo(this.getName()); roomXYZ = p.Xyz; this.waitPlan = p.WaitPlan; loadInfo(this, p, roomContraller); } setCurrentRoom(roomXYZ); this.roomContraller.findRoomByXYZ(roomXYZ).setChara(this); this.roomContraller.setCharaInMiniMap(roomXYZ, this, true); //this.setClickMessage(this.roomContraller.findRoomByXYZ(roomXYZ).findSomethingNews(this).ToArray()); // setBoss(true); }
// private void ReColor (P1, P2: Pointer; C: Byte); // private void ReColor2 (P1, P2: Pointer; C1, C2: Byte); // private void Replace (P1, P2: Pointer; N1, N2: Byte); // private void Mirror (P1, P2: Pointer); // private void Rotate (P1, P2: Pointer); // private void InitSky (NewSky: Byte); // private void InitPipes (NewColor: Byte); // private void InitWalls (W1, W2, W3: Byte); // private void DrawSky (X, Y, W, H: Integer); // private void SetSkyPalette; // private void Redraw (X, Y: Integer); // private void BuildWorld; //// implementation //// // {$I Green.$00} {$I Green.$01} {$I Green.$02} // {$I Green.$03} {$I Green.$04} // // {$I Ground.$00} {$I Ground.$01} {$I Ground.$02} // {$I Ground.$03} {$I Ground.$04} // // {$I Sand.$00} {$I Sand.$01} {$I Sand.$02} // {$I Sand.$03} {$I Sand.$04} // // {$I Brown.$00} {$I Brown.$01} {$I Brown.$02} // {$I Brown.$03} {$I Brown.$04} // // {$I Grass.$00} {$I Grass.$01} {$I Grass.$02} // {$I Grass.$03} {$I Grass.$04} // // {$I Des.$00} {$I Des.$01} {$I Des.$02} // {$I Des.$03} {$I Des.$04} // // {$I Grass1.$00} {$I Grass2.$00} {$I Grass3.$00} // {$I Grass1.$01} {$I Grass2.$01} {$I Grass3.$01} // {$I Grass1.$02} {$I Grass2.$02} {$I Grass3.$02} // // {$I Pipe.$00} {$I Pipe.$01} {$I Pipe.$02} {$I Pipe.$03} // // {$I Block.$00} {$I Block.$01} // // {$I Quest.$00} {$I Quest.$01} // // {$I WPalm.$00} // // {$I Palm0.$00} {$I Palm1.$00} {$I Palm2.$00} {$I Palm3.$00} // {$I Palm0.$01} {$I Palm1.$01} {$I Palm2.$01} {$I Palm3.$01} // {$I Palm0.$02} {$I Palm1.$02} {$I Palm2.$02} {$I Palm3.$02} // // {$I Fence.$00} {$I Fence.$01} // {$I Pin.$00} // // {$I Fall.$00} {$I Fall.$01} // {$I Lava.$00} {$I Lava.$01} // // {$I Lava2.$01} {$I Lava2.$02} {$I Lava2.$03} {$I Lava2.$04} {$I Lava2.$05} // // {$I Tree.$00} {$I Tree.$01} {$I Tree.$02} {$I Tree.$03} // // {$I Brick0.$00} {$I Brick0.$01} {$I Brick0.$02} // {$I Brick1.$00} {$I Brick1.$01} {$I Brick1.$02} // {$I Brick2.$00} {$I Brick2.$01} {$I Brick2.$02} // // {$I Exit.$00} {$I Exit.$01} // {$I Wood.$00} // // {$I Coin.$00} // // {$I Note.$00} // // {$I Window.$00} {$I Window.$01} // // {$I SmTree.$00} {$I SmTree.$01} // // {$I XBlock.$00} // !! Convert is inside of ConvertGrass private void ConvertGrass(P0, P1, P2: ImageBufferPtr) { // var // i, j: Integer; // C0, C1, C2: Byte; }